comparison mercurial/context.py @ 19540:7b864da00e21

basectx: move __str__ from changectx
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 02 Aug 2013 16:46:23 -0500
parents 79671c46bb46
children 421d49f2f8e2
comparison
equal deleted inserted replaced
19539:79671c46bb46 19540:7b864da00e21
32 o._repo = repo 32 o._repo = repo
33 o._rev = nullrev 33 o._rev = nullrev
34 o._node = nullid 34 o._node = nullid
35 35
36 return o 36 return o
37
38 def __str__(self):
39 return short(self.node())
37 40
38 class changectx(basectx): 41 class changectx(basectx):
39 """A changecontext object makes access to data related to a particular 42 """A changecontext object makes access to data related to a particular
40 changeset convenient. It represents a read-only context already presnt in 43 changeset convenient. It represents a read-only context already presnt in
41 the repo.""" 44 the repo."""
137 changeid = hex(changeid) 140 changeid = hex(changeid)
138 except TypeError: 141 except TypeError:
139 pass 142 pass
140 raise error.RepoLookupError( 143 raise error.RepoLookupError(
141 _("unknown revision '%s'") % changeid) 144 _("unknown revision '%s'") % changeid)
142
143 def __str__(self):
144 return short(self.node())
145 145
146 def __int__(self): 146 def __int__(self):
147 return self.rev() 147 return self.rev()
148 148
149 def __repr__(self): 149 def __repr__(self):