我忘了用发布标签来标记我的文件的老版本。旧版本在r13上,最新版本是关于r65的。我将最新的存储库克隆到一个新目录中,执行"hg update -r13“来获取我想要标记的旧代码,然后执行标记命令,但得到消息:
中止:不在分支标头(使用-f强制)
在这种情况下使用-f选项安全吗?
发布于 2011-12-24 08:57:32
我猜你仍然可以在repo中正确地进行标记,而不需要将自己更新到特定的版本。
hg tag -r 13标记名
详情请访问Mercurial wiki。
我试着测试它:
temp $ hg init .
temp $ touch a.txt
temp $ hg add a.txt
temp $ hg commit -m "added a"
temp $ hg status
temp $ echo "sdwwdd" >> a.txt
temp $ hg commit -m "modified a"
temp $ echo "\neddwedd" >> a.txt
temp $ hg commit -m "modified a again"
temp $ hg log
changeset: 2:ef40a402fdab
tag: tip
user: "xxxx"
date: Fri Dec 23 16:51:48 2011 -0800
summary: modified a again
changeset: 1:d630dc3e2e3a
user: "xxxx"
date: Fri Dec 23 16:51:31 2011 -0800
summary: modified a
changeset: 0:7c9917f24515
user: "xxxx"
date: Fri Dec 23 16:51:04 2011 -0800
summary: added a
输出:
temp $ hg tag -r 1 a.txt a_1
temp $ hg tags
tip 3:e3157256098f
a_1 1:d630dc3e2e3a
a.txt 1:d630dc3e2e3a
temp $ hg tag -r 1 all_1
temp $ hg tags
tip 4:a643971911d8
all_1 1:d630dc3e2e3a
a_1 1:d630dc3e2e3a
a.txt 1:d630dc3e2e3a
https://stackoverflow.com/questions/8621874
复制相似问题