.hgtags and merge

Georg gwk.rko at googlemail.com
Thu Dec 21 12:05:50 UTC 2006


2006/12/21, Matt Mackall <mpm at selenic.com>:
>
> On Thu, Dec 21, 2006 at 02:50:53AM +0100, Teemu Torma wrote:
> > I had an issue few days ago about merging .hgtags.
> >
> > This was the mercurial repository itself.  I had added a tag into my
> > repository, not local one since I needed to share it between other
> > local hosts.  When I pulled the mercurial again the 0.9.2 tag was added
> > and merge of .hgtags conflicted.
>
> This is the intended behavior.
>
> > My first thought is that .hgtags should have a special merge treatment
> > to simply combine all possible tags instead of "normal" merge
> > processing (could be handled my the merge script, of course).
>
> Then what happens when tags conflict?



Well I'm not sure but maybe there is different understanding of what a "tag
conflict" should be.  I acutally had the same idea as Teemu.

In my opinion a tag name should only refer to one revision, not several. It
can change over time i.e. in different versions of .hgtags it can point to
different revisions, but in any particular version of .hgtags each tag name
will only occur once, and hence point to only one version.

With that model in mind, the approach for detecting conflicts would be to
check whether the same tag appears in both merge contributors && it points
to different revisions. This is regardless of the tags position in the
.hgtags file.

The text file merge algorithm simply looks at sequences of lines that match
or don't match.  I.e. it compares entire lines, based on their position
within the file (position within context, actually).  It throws a conflict
(afaik) if contributor a) adds tag foo and contributor b) adds tag bar at
the same place within the file.

So in my opinion this is a matter of determining whether there is a
conflict, not what to do if there is one.

What do you think?

--
Regards,
Georg.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20061221/071dd234/attachment-0002.html>


More information about the Mercurial mailing list