Patchwork [08,of,35,V2] context: change _node to node() in hex

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 11:51 p.m.
Message ID <8e61e1dca824364f6ddc.1375919482@laptop.local>
Download mbox | patch
Permalink /patch/2060/
State Accepted
Headers show

Comments

Sean Farley - Aug. 7, 2013, 11:51 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375480213 18000
#      Fri Aug 02 16:50:13 2013 -0500
# Node ID 8e61e1dca824364f6ddc0df2ddbc7586871c4c80
# Parent  0af430229146f6bb0107f2a11be636270be89e70
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().

Patch

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."""