Avoiding conflicts in .hgtags
Greg Ward
gerg.ward+hg at gmail.com
Mon Dec 8 12:52:14 CST 2008
On 08 December 2008, I said:
> The same thought occurred to me, so I've started writing a very
> simplistic and naive script to merge .hgtags files. Will share it
> here for feedback when I've got it working.
As threatened, here is my simple, naive hgmergetags script.
Good points:
* it seems to work
* I think the code is reasonably clear and easy to follow
* it preserves order of the base .hgtags
* similar API to classic Unix diff3 or merge (except it does not
overwrite any input file: currently it just writes the merge
result to stdout)
Bad points:
* it loads everything into memory, so if you have a very large
.hgtags, you will not like this script
* does not preserve order of added tags -- they are just tacked on
to the end (probably only matters if someone manually edits
.hgtags and inserts a tag)
* likewise, conflicts are also tacked on at the end
* no unit tests
I configured it in ~/.hgrc like this:
[merge-patterns]
.hgtags = hgmergetags
[merge-tools]
hgmergetags.args = $local $base $other > $output
Script attached. Feedback welcome.
Greg
More information about the Mercurial
mailing list