Skip to content
Snippets Groups Projects
Commit 545ec177 authored by Matt Mackall's avatar Matt Mackall
Browse files

merge: handle no file parent in backwards merge (issue2364)

parent 8269af35
No related branches found
No related tags found
No related merge requests found
......@@ -276,7 +276,10 @@
fcl = wctx[f]
fco = mctx[f2]
if mctx == actx: # backwards, use working dir parent as ancestor
fca = fcl.parents()[0]
if fcl.parents():
fca = fcl.parents()[0]
else:
fca = repo.filectx(f, fileid=nullrev)
else:
fca = fcl.ancestor(fco, actx)
if not fca:
......
......@@ -166,3 +166,11 @@
+This is file b33
$ hg status
M b
Test for issue2364
$ hg up -qC .
$ hg rm b
$ hg ci -md
$ hg revert -r -2 b
$ hg up -q -- -2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment