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

login
register
mail settings
Submitter Augie Fackler
Date Oct. 8, 2014, 5:06 p.m.
Message ID <9f8980f8de75b63b27d9.1412788009@augie-macbookair>
Download mbox | patch
Permalink /patch/6157/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 8, 2014, 5:06 p.m.
# HG changeset patch
# User Augie Fackler <raf@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.

Patch

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