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

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 15, 2015, 9:46 p.m.
Message ID <d0b0e396081dbe3e3d6e.1444945617@localhost.localdomain>
Download mbox | patch
Permalink /patch/11125/
State Deferred
Headers show

Comments

Mads Kiilerich - Oct. 15, 2015, 9:46 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.

Patch

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: