diff -r 954489932c4f -r a8262b7784f9 mercurial/merge.py --- a/mercurial/merge.py Wed May 31 23:42:58 2017 +0530 +++ b/mercurial/merge.py Wed May 31 23:48:52 2017 +0530 @@ -801,7 +801,7 @@ # manifests fetched in order are going to be faster, so prime the caches [x.manifest() for x in - sorted(wctx.parents() + [p2, pa], key=lambda x: x.rev())] + sorted(wctx.parents() + [p2, pa], key=lambda x: x.rev() or -1)] if followcopies: ret = copies.mergecopies(repo, wctx, p2, pa)