Yes, you can customize the merge tool as described by Krtek. I just tried and it works:
[merge-tools] merge-tags.executable = cat merge-tags.args = $local $other | sort -u >> $output [merge-patterns] .hgtags = merge-tags
Put this in your .hg/hgrc file on the server, and future merges will simply add tags. It happens that hg merge will do
cat /tmp/hgtags.local /tmp/hgtags.other | sort -u >> .hgtags
where the first argument to cat is the local version of the .hgtags file and the second argument is the version you merge with.
I sort and make the output unique in order to avoid duplication of lines that are shared in two files. As long as you add tags only, this will work fine - but if you also remove tags, then the order of the lines in the .hgtags file matters, and therefore you cannot just sort it like that. Please see my extended answer for handling this situation.
This is my test session. I start by creating a repository with two heads:
$ hg init $ echo a > a.txt $ hg add a.txt $ hg commit -ma $ echo b > b.txt $ hg add b.txt $ hg commit -mb $ hg tag b $ hg update 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo c > c.txt $ hg add c.txt $ hg commit -mc created new head $ hg tag c
Branches are visible at the exit of the graphic extension :
@ changeset: 4:54c5397a23a4 | tag: tip | user: Martin Geisler < mg@aragost.com > | date: Wed Mar 02 11:45:20 2011 +0100 | summary: Added tag c for changeset aff5fe9be7d9 | o changeset: 3:aff5fe9be7d9 | tag: c | parent: 0:0db5fae8b6cc | user: Martin Geisler < mg@aragost.com > | date: Wed Mar 02 11:45:17 2011 +0100 | summary: c | | o changeset: 2:a9af8514a64e | | user: Martin Geisler < mg@aragost.com > | | date: Wed Mar 02 11:45:02 2011 +0100 | | summary: Added tag b for changeset 0518533f37f6 | | | o changeset: 1:0518533f37f6 |/ tag: b | user: Martin Geisler < mg@aragost.com > | date: Wed Mar 02 11:44:44 2011 +0100 | summary: b | o changeset: 0:0db5fae8b6cc user: Martin Geisler < mg@aragost.com > date: Wed Mar 02 11:44:33 2011 +0100 summary: a
There is a conflict in the .hgtags file:
$ hg cat -r 2 .hgtags 0518533f37f6f37edbea5b46d9af2192f69ddecd b $ hg cat -r 4 .hgtags aff5fe9be7d9b021e55dfb522b29fd03cbcf5cb7 c
but the merge is still not interactive:
$ hg merge merging .hgtags 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit)
You can see how the files were added:
$ cat .hgtags aff5fe9be7d9b021e55dfb522b29fd03cbcf5cb7 c 0518533f37f6f37edbea5b46d9af2192f69ddecd b