【问题标题】:Mercurial / hg - abort: outstanding uncommitted mergesMercurial / hg - abort:未提交的未提交合并
【发布时间】:2012-10-02 12:47:45
【问题描述】:

我在 host1 上有一个主存储库,并对 host2 上的一个存储库进行了更新。我hg pushed 修改了从 host2 到 host1 的内容

[mpenning@host2 login]$  hg push ssh://host1//opt/python/login

但是,当我尝试更新或合并时,我得到了

[mpenning@host1 login]$ hg update
abort: outstanding uncommitted merges
[mpenning@host1 login]$ hg merge
abort: outstanding uncommitted merges
[mpenning@host1 login]$ 

我还尝试了来自 host1 的 hg pull,但这也没有用...

[mpenning@host1 login]$ hg pull ssh://host2//opt/python/login
running ssh host2 'hg -R /opt/python/login serve --stdio'
mpenning@host2's password:
pulling from ssh://host2//opt/python/login
searching for changes
no changes found
[mpenning@host1 login]$ hg merge
abort: outstanding uncommitted merges
[mpenning@host1 login]$

我需要做什么才能使用来自 host2 的更改更新我在 host1 上的主存储库?


有关 host1 上的 repo 的更多信息...

[mpenning@host1 login]$ hg parents
changeset:   27:6d530d533997
user:        Mike Pennington <d.pennington@foo.local>
date:        Wed Sep 26 11:44:51 2012 -0500
files:       mp_getconf.py
description:
fix issue where config retrieval was broken


changeset:   29:eaf3b5aacfe6
user:        Mike Pennington <d.pennington@foo.local>
date:        Wed Sep 26 11:43:15 2012 -0500
files:       mp_getconf.py
description:
fix artifact of using the script to run generic commands, but this broke config retrieval


[mpenning@host1 login]$

【问题讨论】:

    标签: mercurial


    【解决方案1】:

    hg update --clean -r tip 解决了问题...

    [mpenning@host1 login]$ hg update --clean -r tip
    resolving manifests
    getting Protocol.py
    getting Session.py
    getting mp_getconf.py
    getting mp_runcmd.py
    4 files updated, 0 files merged, 0 files removed, 0 files unresolved
    [mpenning@host1 login]$ hg up
    resolving manifests
    0 files updated, 0 files merged, 0 files removed, 0 files unresolved
    [mpenning@host1 login]$
    

    【讨论】:

    • 如果您正在处理特定分支,请将其更改为: hg update --clean -r
    • 我不想放弃提交 (--clean)。虽然我现在看不到他们。
    • 除非必须,否则不要使用它。这将删除您的更改
    • 有一个简单的解决方法来丢失更改;在运行命令之前备份您关心的所有文件
    【解决方案2】:

    在某些时候你做到了:

    $ hg pull (or maybe someone pushed to you)
    $ hg merge
    

    ...然后继续。这使合并未提交。这就是“中止:未提交的合并”的意思。你不能做'x',因为你还没有完成你开始的合并工作。

    你应该做的是:

    $ hg pull
    $ hg merge
      <Sorted out any issues>
    $ hg commit -m 'Merged the blah with wibble-wah'
    

    ...然后继续。

    hg statushg summary 会显示有明显的变化。

    【讨论】:

    • 你的指控是我有突出的变化......如果是这样,为什么hg update / hg commit 没有解决这个问题? hg commit 告诉我没有什么可提交的
    • 'hg update' 在有未完成的更改时不会做任何事情,除非您提供 '--clean' 以丢弃更改,就像您在自我回答中所做的那样。 'hg parents' 给了两个父母的事实表明你有一个优秀的合并。在您的第一篇文章中没有尝试提交。
    • 没有提交,因为它什么也没做;除非您提供比hg commit 更多的信息,否则恐怕这无济于事
    • 我也遇到了同样的问题。 hg status、hg diff 或 hg out 中没有任何内容。不过,我无法更新或合并。接受的答案为我解决了这个问题。
    • @JohanTidén :update --clean 将解决问题,因为它会清除所有未完成的更改,包括拥有多个父级(即您正在执行合并)。我预计正在发生的事情是人们尝试进行合并,然后通过执行revert -a 中止它。 revert 仅撤消对文件的更改,并且不会断开与第二个父级的链接,使您处于这样的状态(statusdiff 空白,因为文件更改已恢复,outgoing 空白因为没有传出的提交)。这对于执行“空合并”很有用,但通常不是您想要的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-12
    • 2012-01-01
    • 2012-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多