comparison mercurial/context.py @ 19601:f284907631f5

basefilectx: move changectx from filectx
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 11 Aug 2013 22:56:02 -0500
parents 12cdff44fdc4
children 018ee491a6be
comparison
equal deleted inserted replaced
19600:12cdff44fdc4 19601:f284907631f5
509 return self._changectx.phase() 509 return self._changectx.phase()
510 def phasestr(self): 510 def phasestr(self):
511 return self._changectx.phasestr() 511 return self._changectx.phasestr()
512 def manifest(self): 512 def manifest(self):
513 return self._changectx.manifest() 513 return self._changectx.manifest()
514 def changectx(self):
515 return self._changectx
514 516
515 class filectx(basefilectx): 517 class filectx(basefilectx):
516 """A filecontext object makes access to data related to a particular 518 """A filecontext object makes access to data related to a particular
517 filerevision convenient.""" 519 filerevision convenient."""
518 def __init__(self, repo, path, changeid=None, fileid=None, 520 def __init__(self, repo, path, changeid=None, fileid=None,
564 def filectx(self, fileid): 566 def filectx(self, fileid):
565 '''opens an arbitrary revision of the file without 567 '''opens an arbitrary revision of the file without
566 opening a new filelog''' 568 opening a new filelog'''
567 return filectx(self._repo, self._path, fileid=fileid, 569 return filectx(self._repo, self._path, fileid=fileid,
568 filelog=self._filelog) 570 filelog=self._filelog)
569
570 def changectx(self):
571 return self._changectx
572 571
573 def data(self): 572 def data(self):
574 return self._filelog.read(self._filenode) 573 return self._filelog.read(self._filenode)
575 def path(self): 574 def path(self):
576 return self._path 575 return self._path