[PATCH remotefilelog] shallowbundle: specifically compare instance to remotefilelog.remotefilelog

Martin von Zweigbergk martinvonz at google.com
Sat Jul 16 02:58:21 EDT 2016


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1468651989 25200
#      Fri Jul 15 23:53:09 2016 -0700
# Node ID b2a93bc0af645160828399e51970e1e6c778b130
# Parent  066664a96b8fdce9184a21184dbaf66c5a762d38
shallowbundle: specifically compare instance to remotefilelog.remotefilelog

In two place, we were checking if a revlog was an instance of
revlog.revlog and, I think, treating it as a
remotefilelog.remotefilelog otherwise. I noticed this when I created
another non-revlog.revlog revlog in narrowhg and remotefilelog thought
it was a remotefilelog.remotefilelog. Let's specifically check if it's
a remotefilelog.remotefilelog instead.

diff -r 066664a96b8f -r b2a93bc0af64 remotefilelog/shallowbundle.py
--- a/remotefilelog/shallowbundle.py	Thu Jul 07 15:59:06 2016 -0700
+++ b/remotefilelog/shallowbundle.py	Fri Jul 15 23:53:09 2016 -0700
@@ -8,7 +8,7 @@
 import fileserverclient, remotefilelog, shallowutil
 import collections, os
 from mercurial.node import bin, hex, nullid, nullrev
-from mercurial import changegroup, revlog, phases, mdiff, match, bundlerepo
+from mercurial import changegroup, phases, mdiff, match, bundlerepo
 from mercurial import util, error
 from mercurial.i18n import _
 
@@ -19,7 +19,7 @@
 requirement = "remotefilelog"
 
 def shallowgroup(cls, self, nodelist, rlog, lookup, units=None, reorder=None):
-    if isinstance(rlog, revlog.revlog):
+    if not isinstance(rlog, remotefilelog.remotefilelog):
         for c in super(cls, self).group(nodelist, rlog, lookup,
                                         units=units):
             yield c
@@ -135,7 +135,7 @@
         return NoFiles
 
     def prune(self, rlog, missing, commonrevs):
-        if isinstance(rlog, revlog.revlog):
+        if not isinstance(rlog, remotefilelog.remotefilelog):
             return super(shallowcg1packer, self).prune(rlog, missing,
                 commonrevs)
 


More information about the Mercurial-devel mailing list