[PATCH 1 of 5 manifest-cleanup] revlog: mark nullhash as module-private

Augie Fackler raf at durin42.com
Wed Oct 8 17:06:49 UTC 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1411585852 14400
#      Wed Sep 24 15:10:52 2014 -0400
# Node ID 9f8980f8de75b63b27d92780ef504cef1f9c9b0f
# Parent  a1eb21f5caea4366310e32aa85248791d5bbfa0c
revlog: mark nullhash as module-private

No other module should ever need this, so mark it with _ so nobody
tries to use it.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -52,7 +52,7 @@
 def offset_type(offset, type):
     return long(long(offset) << 16 | type)
 
-nullhash = _sha(nullid)
+_nullhash = _sha(nullid)
 
 def hash(text, p1, p2):
     """generate a hash from the given text and its parent hashes
@@ -64,7 +64,7 @@
     # As of now, if one of the parent node is null, p2 is null
     if p2 == nullid:
         # deep copy of a hash is faster than creating one
-        s = nullhash.copy()
+        s = _nullhash.copy()
         s.update(p1)
     else:
         # none of the parent nodes are nullid


More information about the Mercurial-devel mailing list