Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 19591:04fbc85f870a
basefilectx: move hex from filectx
We also change the function call to use the hex method of its change context
so that it mirrors other such method calls.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 11 Aug 2013 22:53:23 -0500 |
parents | 90994b176bc1 |
children | 1cdb3b3df4df |
comparison
equal
deleted
inserted
replaced
19590:90994b176bc1 | 19591:04fbc85f870a |
---|---|
489 return self._changeid | 489 return self._changeid |
490 def linkrev(self): | 490 def linkrev(self): |
491 return self._filelog.linkrev(self._filerev) | 491 return self._filelog.linkrev(self._filerev) |
492 def node(self): | 492 def node(self): |
493 return self._changectx.node() | 493 return self._changectx.node() |
494 def hex(self): | |
495 return self._changectx.hex() | |
494 | 496 |
495 class filectx(basefilectx): | 497 class filectx(basefilectx): |
496 """A filecontext object makes access to data related to a particular | 498 """A filecontext object makes access to data related to a particular |
497 filerevision convenient.""" | 499 filerevision convenient.""" |
498 def __init__(self, repo, path, changeid=None, fileid=None, | 500 def __init__(self, repo, path, changeid=None, fileid=None, |
545 '''opens an arbitrary revision of the file without | 547 '''opens an arbitrary revision of the file without |
546 opening a new filelog''' | 548 opening a new filelog''' |
547 return filectx(self._repo, self._path, fileid=fileid, | 549 return filectx(self._repo, self._path, fileid=fileid, |
548 filelog=self._filelog) | 550 filelog=self._filelog) |
549 | 551 |
550 def hex(self): | |
551 return hex(self.node()) | |
552 def user(self): | 552 def user(self): |
553 return self._changectx.user() | 553 return self._changectx.user() |
554 def date(self): | 554 def date(self): |
555 return self._changectx.date() | 555 return self._changectx.date() |
556 def files(self): | 556 def files(self): |