diff -r 4add43865a9b -r db0740a487ab mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Feb 24 22:42:13 2014 +0100 +++ b/mercurial/localrepo.py Mon Feb 24 22:42:14 2014 +0100 @@ -1123,6 +1123,8 @@ self.ui.warn(_("warning: can't find ancestor for '%s' " "copied from '%s'!\n") % (fname, cfname)) + elif fparent1 == nullid: + fparent1, fparent2 = fparent2, nullid elif fparent2 != nullid: # is one parent an ancestor of the other? fparentancestor = flog.ancestor(fparent1, fparent2)