If you are merging changes from repository B into repository A should you merge changes in .hgtags?
Repository B could have had tags 1.01, 1.02, 1.03 which are not in A. Why would you ever merge those into repository A's .hgtags file? If we merged and then tried to view repository A by looking at tag 1.01, I would think this wouldn't work.
In the Merge dialog that opens, choose the target repository from the Repository list which shows all the Mercurial repositories available under the current project root. Choose the Branch or Bookmark option and choose the named branch or bookmark to merge the current working directory with.
If you want to remove a tag that you no longer want, use hg tag --remove . You can also modify a tag at any time, so that it identifies a different revision, by simply issuing a new hg tag command. You'll have to use the -f option to tell Mercurial that you really want to update the tag.
hg graft has additional functionality over and above simple cherry picking of one revision. For example, you can graft a range of revisions onto another branch.
Thus Mercurial stores tags as a file in the working dir. This file is called . hgtags and consists of a list of changeset IDs and their corresponding tags. To add a tag to the system, simply add a line to this file and then commit it for it to take effect.
Short Answer: This does work properly and you should merge .hgtags
Why should you actually merge .hgtags
and why does it make sense?
So you have
The above is listed as the Changeset Number (long unique hex id) tag
So you merge repo B into Repo A and get something that looks like.
9 (a4) merge
/ \
| 8 (b3) tag 1.01
| |
| 7 (b2)
| |
| 6 (b1)
5 (a3) |
| |
4 (a2) |
| |
3 (a1) |
\ /
2 (a0)
If you update the repo to tag 1.01 you will get exactly what the code looked like at that point in time When it was in Repo B just as mercurial promises.
You should merge them as the changesets from Repo B that were tagged are now part of the changeset tree in Repo A, so therefore the changesets you tagged in Repo B are now tagged in Repo A. Not merging them would just cause you to lose the tags that you created for the changesets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With