没有父母的mercurial修订是什么意思?

前端之家收集整理的这篇文章主要介绍了没有父母的mercurial修订是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我现在有一个处于奇怪状态的Mercurial存储库.这就是TortoiseHG的样子: @H_502_2@我不认为这是可能的.修订版54具有父“1(000000000000)”(即没有).显然我对Mercurial还有一些不了解的事情,任何人都可以让我知道这意味着什么 – 以及进入这种状态必然会发生什么.据我所知,它只是推送和拉出它的东西 – 并没有人使用任何古怪的扩展.

@H_502_2@修订版54和55只是添加标签,但如果我’更新-C’到版本54,我最终只能使用.hgtags文件.

@H_502_2@我从修订版53中克隆了一下来解决这个问题.但我宁愿理解这里发生的事情,所以我可以避免它再次发生.

解决方法

当您查看 definition of a changeset时,您会看到:
@H_502_2@Each changeset has zero,one or two parent changesets:

  • It has two parent changesets,if the commit was a merge.
  • It has no parent,if the changeset is a root in the repository.
    There may be multiple roots in a repository (normally,there is only one),each representing the start of a branch.
@H_502_2@“Updating” back to a changeset which already has a child,changing files and then committing creates a new child changeset,thus starting a new branch. Branches can be named.

@H_502_2@也许这就是你做的:

@H_502_2@>更新回53(当时已经有一个孩子’54’了)
>更改文件
>提交,从而从54开始一个新的分支,没有父母
(那将使用相同的父进行第二次提交)

@H_502_2@要么:

@H_502_2@>用--close-branch option进行53投票,
>可能新的提交(不切换回另一个分支)可能会开始一个新的提交

@H_502_2@Ry4an(真正的Mercurial专家;))编钟和评论

@H_502_2@--close-branch doesn’t do anything except hide a branch from a list,and it’s undone next time you commit on that branch. It won’t create multiple roots.

@H_502_2@VonC is right in his diagnosis,multiple heads.
But no combination of ‘update‘ and ‘commit‘ will get you into that state.
To end up with multiple roots one usually has done a ‘hg pull‘ from repo and used --force to override an “unrelated repositories” warning.

@H_502_2@(“无父”,表示父ID设置为00000,见“behind the scene”

@H_502_2@alt text http://hgbook.red-bean.com/read/figs/revlog.png)

猜你在找的Python相关文章