Mercurial / hg - abort: outstanding uncommitted merges
Solution 1
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]$
Solution 2
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.
![Mike Pennington](https://i.stack.imgur.com/BPTe1.jpg?s=256&g=1)
Comments
-
Mike Pennington almost 2 years
I have a master repo on host1 and made an update to a repo on host2. I
hg push
ed 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 <[email protected]> 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 <[email protected]> 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]$
-
Mike Pennington over 11 yearsYour 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 -
Paul S over 11 years'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.
-
Mike Pennington over 11 yearsThere 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 -
Chip McCormick over 11 yearsif you're working on a specific branch, change that to: hg update --clean -r <branchname>
-
Johan Tidén over 9 yearsI 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.
-
Paul S over 9 years@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 doingrevert -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
anddiff
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. -
Csaba Toth almost 9 yearsI 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 almost 9 yearsBTW, I do not want to clean my commits, that would be stupid. But there's nothing to commit.
-
Csaba Toth almost 9 yearsI do not want to loose commits (--clean). Although I don't see them now.
-
Ryan110 about 5 yearsdo not use this untill you have to. this would remove your change
-
Mike Pennington about 5 yearsThere’s a simple workaround for loosing the change; make a backup of all files you care about before running the command