55

I have a master repo on host1 and made an update to a repo on host2. I hg pushed the changes from host2 to host1 with

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

However, when I try to update or merge, I get

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

I also tried a hg pull from host1, but that didn't work either...

[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]$

What do I need to do to update my master repo on host1 with the changes from host2?


More information about the repo on host1...

[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]$
Community
  • 1
  • 1
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174

2 Answers2

103

hg update --clean -r tip resolved the problem...

[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]$
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
14

At some point you did:

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

...and then carried on. This left the merge uncommitted. That's what 'abort: outstanding uncommitted merges' means. You can't do 'x' because there's you haven't finished working on the merge you started.

What you should have done is:

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

...and then carried on.

hg status and hg summary would have shown there were outstanding changes.

Paul S
  • 7,645
  • 2
  • 24
  • 36
  • 1
    Your allegation is that I had outstanding changes... if so, why didn't `hg update` / `hg commit` fix that problem? `hg commit` told me there was nothing to commit – Mike Pennington Oct 04 '12 at 23:42
  • 'hg update' wont do anything when theres outstanding changes unless you give '--clean' to throw the changes away, just as you did in your self-answer. The fact that 'hg parents' gave two parents shows you had a merge outstanding. There was no attempt to commit in your first post. – Paul S Oct 05 '12 at 07:55
  • There was no commit because it wasn't doing anything; unless you come up with more information than `hg commit`, I'm afraid this would not have helped – Mike Pennington Oct 05 '12 at 13:18
  • 2
    I just got the same issue. There is nothing in hg status, hg diff or hg out. Still, I cannot update or merge. The accepted answer solved it for me. – Johan Tidén Jan 09 '15 at 09:44
  • 1
    @JohanTidén : An `update --clean` will solve the issue because it cleans out **all** outstanding changes, including having multiple parents (i.e. you're doing a merge). I expect what is happening is that people try to do a merge, and then abort it by doing `revert -a`. `revert` only undoes the changes to the files, and doesn't break the link to the second parent, leaving you in a state like this (`status` and `diff` blank because file changes have been reverted, `outgoing` blank because no outgoing **commits**). This can be useful for doing a "null merge", but isn't usually what you want. – Paul S Jan 16 '15 at 11:02
  • I haven't done any revert or anything. I just forgot to commit before pull, and now hg is trippin'. This is ridiculous (form hg). If the problem is that I had outstanding commits, why there's nothing to commit now? – Csaba Toth Jul 23 '15 at 17:31
  • BTW, I do not want to clean my commits, that would be stupid. But there's nothing to commit. – Csaba Toth Jul 23 '15 at 17:32