gpt4 book ai didi

Mercurial , "Branching with bookmarks"

转载 作者:行者123 更新时间:2023-12-04 05:14:59 25 4
gpt4 key购买 nike

我阅读了这份文档:A Guide to Branching with Mercurial,特别是标题为Branching with Bookmarks的部分。
它说:

Now you’ve got two bookmarks (essentially a tag) for your two branches at the current changeset.

To switch to one of these branches you can use hg update feature to update to the tip changeset of that branch and mark yourself as working on that branch. When you commit, it will move the bookmark to the newly created changeset.


我尝试了此操作,但最终却同时移动了两个书签。
该指南是错误的,过时的,还是我做错了什么?请注意,我知道在单独的分支上具有书签只会移动与我当前正在使用的分支相关的书签,但是该指南(很多人说这是明确的指南)明确指出了上面的文字,这表明它应该通过“告诉” Mercurial来工作,该书签(分支)是我正在处理的。
测试显示了相反的情况。
有任何想法吗?
例子:
> hg初始化
>回声1> test.txt
> hg commit -m“initial” --addremove
添加test.txt

> hg书签主
> hg书签功能
> Mercurial 日志
变更集:0:c56ceb49ee20
标签:功能
标签:主要
标签:小费
用户:Lasse V. Karlsen
日期:2010年11月30日星期二23:06:16 +0100
摘要:初始

> Mercurial 更新功能
更新了0个文件,合并了0个文件,删除了0个文件,未解决0个文件

>回声2> test2.txt
> hg commit -m“功能1” --addremove
添加test2.txt

> Mercurial 日志
变更集:1:9f2f5869b57b
标签:功能<----都被移动了
标签:主要<----
标签:小费
用户:Lasse V. Karlsen
日期:2010年11月30日星期二23:06:45 +0100
摘要:功能1

变更集:0:c56ceb49ee20
用户:Lasse V. Karlsen
日期:2010年11月30日星期二23:06:16 +0100
摘要:初始

最佳答案

如果我理解正确,则只希望您已更新的书签在下一次提交时继续移动。为此,书签扩展具有track.current选项。

BookmarksExtension:

By default, when several bookmarks point to the same changeset, they will all move forward together. It is possible to obtain a more Git-like experience by adding the following configuration option to your .hgrc


[bookmarks]
track.current = True

在您的示例中,这将使主书签的修订版为0。

如果启用了 track.current选项,则当前事件的书签在 hg bookmarks的输出中带有星号注释。

更新:由于Mercurial 1.8,默认行为是仅移动当前书签,即不再需要上述选项 [1]

关于 Mercurial , "Branching with bookmarks",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4319232/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com