[PATCH 07 of 36] context: change _node to node() in hex

Sean Farley sean.michael.farley at gmail.com
Wed Aug 7 13:13:07 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1375480213 18000
#      Fri Aug 02 16:50:13 2013 -0500
# Node ID 18155de59edb65e797b585c23ae0a70d04eae7c7
# Parent  499a421b6679441120ceba566342115e9ae0b633
context: change _node to node() in hex

This allows a child class to overload the node() function and still share the
same code for hex().

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -41,11 +41,11 @@
     def rev(self):
         return self._rev
     def node(self):
         return self._node
     def hex(self):
-        return hex(self._node)
+        return hex(self.node())
 
 class changectx(context):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
     the repo."""


More information about the Mercurial-devel mailing list