From patchwork Wed Aug 7 18:13:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [08,of,36] context: move __int__ from changectx From: Sean Farley X-Patchwork-Id: 2025 Message-Id: <24cb20d7bce4cee55bb9.1375899188@laptop.local> To: mercurial-devel@selenic.com Date: Wed, 07 Aug 2013 13:13:08 -0500 # HG changeset patch # User Sean Farley # Date 1375480333 18000 # Fri Aug 02 16:52:13 2013 -0500 # Node ID 24cb20d7bce4cee55bb91af047a901841fdfdd6d # Parent 18155de59edb65e797b585c23ae0a70d04eae7c7 context: move __int__ from changectx 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 "" % str(self) def __hash__(self): try: