Mercurial: "An unexplored file in the working directory is different from the file in the requested revision"?

Can someone tell me what this Mercury error means?

untracked file in working directory is different from file in requested revision

This happened while doing hg fetch:

C:\myapp>hg fetch ssh://hg/myapp-v1 pulling from ssh://hg/myapp-v1 searching for changes adding changesets adding manifests adding file changes added 93 changesets with 693 changes to 78 files (+1 heads) updating to 797:0df7dbe7dc06 196 files updated, 0 files merged, 196 files removed, 0 files unresolved merging with 704:edb7765768c6 abort: untracked file in working directory differs from file in requested revision: 'a/b/c/d.java' 

From what I can tell, this file (a / b / c / d.java) does not match any path configured in .hgignore. And this particular file is also identical in the two (myapp and myapp-v1) repositories.

I do not understand what it means.??

+63
merge mercurial
Jan 27 2018-11-21T00:
source share
5 answers

It is reported that you already have a file named a/b/c/d.java in the local a/b/c/d.java repo working directory, but it has not been added (tracked), and the selection does not want to overwrite it when updating / merging.

The things you can do is broadcast:

  • Disconnect your copy of a/b/c/d.java , and then run the pull / update command. After that, compare the portable a/b/c/d.java with the one that is called upon extraction.

or

  • hg add a/b/c/d.java , hg commit a/b/c/d.java and then pull / merge

The first one works because there is no longer a file in the path, and later it works because your copy is being tracked, so Mercurial can combine them.

In addition, you should consider using fetch . It combines pull and update and merge for you, which is simply not a safe way to be. In this case, your pull succeeded, and both update and merge provided you with much more useful messages.

+68
Jan 27 '11 at 21:50
source share

I got around this by running hg update --clean

+15
Jul 06 '16 at 16:36
source share

I tried Ry4an to answer (about deleting the file) and it still does not work, so I started cleaning and got rid of all the traces with which he worked. Just in case, someone is looking for an alternative solution.

+8
Jul 01 '15 at 21:53
source share

Just accept the error dialog and then check Discard local changes, no backup

enter image description here

And you should be fine, it will overwrite any unplayable local files ...

+4
Nov 22 '16 at 2:31 on
source share

When using TortoiseHG, you can check the "Undo local changes without backup" option in the "Update" window.

+3
Oct 10 '16 at 8:38
source share



All Articles