Change order of lines in .hgtags to alleviate merge conflicts?

Greg Ward greg at gerg.ca
Sat Apr 2 16:02:23 CDT 2011


On 02 April 2011, Jason Harris said:
> What would people think about changing the 'hg tag <tagname>'
> command so that it inserted the tags in the list of tags according to
> the changeset hash or according to the tag name. The reason for doing
> this is to improve merges when tags change on separate branches.

You can't do that: order matters in .hgtags.  Think about what happens
if you create tag foo, then in separate branches you move the tag and
I delete it.  In the merge, one of us *has* to get a conflict and
.hgtags has to record how it was resolved.  It does this by printing
multiple entries for the tag, and sorting out exactly what it all
means when reading .hgtags.

Roughly speaking, order in .hgtags reflects the order in which tags
were created/modified/removed.

        Greg


More information about the Mercurial-devel mailing list