Patchwork [03,of,36] context: move __str__ from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 6:13 p.m.
Message ID <8fc7a11d2a2f02bd6491.1375899183@laptop.local>
Download mbox | patch
Permalink /patch/2020/
State Superseded
Commit b88f5b0d8880c52c70999ebcd499b0280733822b
Delegated to: Augie Fackler
Headers show

Comments

Sean Farley - Aug. 7, 2013, 6:13 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375479983 18000
#      Fri Aug 02 16:46:23 2013 -0500
# Node ID 8fc7a11d2a2f02bd6491fa9c24656d0e44a0a92d
# Parent  8e7a1ca270327a1e3e42e421d7bb897b84d752b7
context: move __str__ from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -33,10 +33,13 @@ 
         o._rev = nullrev
         o._node = nullid
 
         return o
 
+    def __str__(self):
+        return short(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."""
     def __init__(self, repo, changeid=''):
@@ -132,13 +135,10 @@ 
         except TypeError:
             pass
         raise error.RepoLookupError(
             _("unknown revision '%s'") % changeid)
 
-    def __str__(self):
-        return short(self.node())
-
     def __int__(self):
         return self.rev()
 
     def __repr__(self):
         return "<changectx %s>" % str(self)