mercurial/merge.py
changeset 12664 545ec1775021
parent 12401 4cdaf1adafc8
child 12681 bc13e17067d9
--- a/mercurial/merge.py	Sat Oct 09 14:52:58 2010 -0500
+++ b/mercurial/merge.py	Sat Oct 09 14:50:20 2010 -0500
@@ -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: