[PATCH 2 of 3] merge: provide *_ISLINK environment vars to merge helper
Steve Borho
steve at borho.org
Fri Oct 5 18:29:41 UTC 2007
On Fri, 2007-10-05 at 18:47 +0200, Patrick Mézard wrote:
> Steve Borho a écrit :
> > On Fri, 2007-10-05 at 10:23 -0500, Matt Mackall wrote:
> >> On Fri, Oct 05, 2007 at 12:55:43AM +0200, Patrick Mezard wrote:
> >>> # HG changeset patch
> >>> # User Patrick Mezard <pmezard at gmail.com>
> >>> # Date 1191445776 -7200
> >>> # Node ID 51655b6b134e2bb19ba75e65e6bdc82108a563bb
> >>> # Parent 1f29a31ea5ba0aab660c18e5678942e82d462be6
> >>> merge: provide *_ISLINK environment vars to merge helper
> >>>
> >>> Sets HG_MY_ISLINK, HG_OTHER_ISLINK, HG_BASE_ISLINK in environment. Without these variables, it's impossible for the merge application to know whether the 'other' and 'base' files were symlinks in their original contexts. For the purposes of the merge they are always emitted as small text files.
> >> If they have a filename and a revision id, it certainly is possible to
> >> know: just ask hg.
> >
> > Perhaps this could be solved in a different way. Is there any reason
> > not to call util.set_link() on the base and other temp files when
> > applicable? That would eliminate the ambiguity.
>
> That would not work on systems not supporting symlinks.
The behavior would be the same as it is now. Symlinks would be
represented as small text files, and after the merge the local file will
inherit the symlink flag of it's first parent.
> I think we really want to abort symlink merges on these.
In my view, Mercurial merge should treat symlinks similar to the way it
treats renames. Instead of spawning the merge helper it should simply
ask the user to select between the local and other version. It would
avoid all the problems of non-supporting systems and non-symmetrical
merges (where one file is a symlink while the other is not). I guess
the difficulty would be in recording the choice in the dirstate somehow
until the user commits the merge results.
--
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F E2E4 B0C2 5292 F2C6 2C8C
More information about the Mercurial-devel
mailing list