From patchwork Wed Aug 7 23:51:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [09,of,35,V2] context: move __int__ from changectx From: Sean Farley X-Patchwork-Id: 2062 Message-Id: <01254518b9859d737b30.1375919483@laptop.local> To: mercurial-devel@selenic.com Date: Wed, 07 Aug 2013 18:51:23 -0500 # HG changeset patch # User Sean Farley # Date 1375480333 18000 # Fri Aug 02 16:52:13 2013 -0500 # Node ID 01254518b9859d737b30c24db261dd2134db54e0 # Parent 8e61e1dca824364f6ddc0df2ddbc7586871c4c80 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): @@ -148,13 +151,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: