There was a recent thread about this "[RFC] prohibit push to lightweight checkout" (I think it's the same issue.)
One option: give a warning when opening a file URL relative to a remote URL. There may be some false hits so we could start with just a warning.
Another option: always store a relative URL; I put up a branch for this but people raised the concern that this would cause trouble if they move their checkouts to a different directory. Perhaps that is a less important case or a less problematic breakage than this.
There was a recent thread about this "[RFC] prohibit push to lightweight checkout" (I think it's the same issue.)
One option: give a warning when opening a file URL relative to a remote URL. There may be some false hits so we could start with just a warning.
Another option: always store a relative URL; I put up a branch for this but people raised the concern that this would cause trouble if they move their checkouts to a different directory. Perhaps that is a less important case or a less problematic breakage than this.