Patchwork [08,of,36] context: move __int__ from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 6:13 p.m.
Message ID <24cb20d7bce4cee55bb9.1375899188@laptop.local>
Download mbox | patch
Permalink /patch/2025/
State Superseded
Commit da6442d295b49f2ee978a6f98bc17513e5dec153
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 1375480333 18000
#      Fri Aug 02 16:52:13 2013 -0500
# Node ID 24cb20d7bce4cee55bb91af047a901841fdfdd6d
# Parent  18155de59edb65e797b585c23ae0a70d04eae7c7
context: move __int__ from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -36,10 +36,13 @@ 
         return o
 
     def __str__(self):
         return short(self.node())
 
+    def __int__(self):
+        return self.rev()
+
     def rev(self):
         return self._rev
     def node(self):
         return self._node
     def hex(self):
@@ -142,13 +145,10 @@ 
         except TypeError:
             pass
         raise error.RepoLookupError(
             _("unknown revision '%s'") % changeid)
 
-    def __int__(self):
-        return self.rev()
-
     def __repr__(self):
         return "<changectx %s>" % str(self)
 
     def __hash__(self):
         try: