[PATCH 2 of 2] convert: don't try to use a p2-clean file from p2 if it doesn't exist in p2

Mads Kiilerich mads at kiilerich.com
Thu Oct 15 16:46:57 CDT 2015


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1444945409 -7200
#      Thu Oct 15 23:43:29 2015 +0200
# Node ID d0b0e396081dbe3e3d6e5d2aa7063503e4ee48c2
# Parent  8c7010f12530b69c86d2bcdd70098ced582ece49
convert: don't try to use a p2-clean file from p2 if it doesn't exist in p2

Reenable the p2 optimization but skip it if the file doesn't exist in p2. That
replaces the change from 5ca587348875.

diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -221,14 +221,9 @@ class mercurial_sink(converter_sink):
         files = dict(files)
 
         def getfilectx(repo, memctx, f):
-            if p2ctx and f in p2files and f not in copies and False:
+            if p2ctx and f in cleanp2 and f in p2ctx and f not in copies:
                 self.ui.debug('reusing %s from p2\n' % f)
-                try:
-                    return p2ctx[f]
-                except error.ManifestLookupError:
-                    # If the file doesn't exist in p2, then we're syncing a
-                    # delete, so just return None.
-                    return None
+                return p2ctx[f]
             try:
                 v = files[f]
             except KeyError:


More information about the Mercurial-devel mailing list