开发者

How to tag a certain folder in my source tree?

I am using the mercurial command line and I can't find out how to tag a certain folder. My source repository consists from different libraries so I'd like to tag them separately.

I also mistakenly tagged my whole so开发者_运维知识库urce tree, so I'd like to know how do I erase a tag before I create the new tag.


You can only tag a revision, not a specific file or folder.

To erase a tag, issue the following command:

hg tag --remove TAG

To move a tag to a different revision:

hg tag --force TAG --rev REV

Note that in both cases, you'll end up creating a new changeset on top of the one you're at, you can't eradicate the commit that was created when the original tag was made.


As Lasse states, you can only tag a revision of the entire repository in Mercurial. In order to tag different components in your repository you could consider using Mercurial Subrepositories. Subrepositories allow you to treat individual components (what you are calling libraries) as independent repositories, and pull them together into a single, functional unit.

In terms of BitBucket's limitation on private repos - you could consider making some of them public, or placing the main repository on a local machine or server if you're concerned about exposing source publicly. If you're interested in hosting something yourself, Redmine is a good free tool that would allow you to serve as many repos as you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜