remotefilelog: accepting a None node to cmp draft
authorrdamazio@google.com
Mon, 10 Dec 2018 17:49:51 -0800
changeset 53699 4e17679c336b
parent 53697 008f3491dc53
child 53700 76d8b20139a3
push id1082
push usergszorc@mozilla.com
push dateWed, 12 Dec 2018 00:02:30 +0000
remotefilelog: accepting a None node to cmp In context.py, basefilectx.cmp explicitly calls it with None, so it has to be supported. Specifically, this breaks "hg absorb -i" currently. Differential Revision: https://phab.mercurial-scm.org/D5409
hgext/remotefilelog/remotefilelog.py
--- a/hgext/remotefilelog/remotefilelog.py
+++ b/hgext/remotefilelog/remotefilelog.py
@@ -182,17 +182,17 @@ class remotefilelog(object):
     rawsize = size
 
     def cmp(self, node, text):
         """compare text with a given file revision
 
         returns True if text is different than what is stored.
         """
 
-        if node == nullid:
+        if not node or node == nullid:
             return True
 
         nodetext = self.read(node)
         return nodetext != text
 
     def __nonzero__(self):
         return True