comparison mercurial/context.py @ 19606:284f91230c07

basefilectx: move p1 from filectx
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 11 Aug 2013 22:59:10 -0500
parents cf7322cb1c13
children 056a949799ac
comparison
equal deleted inserted replaced
19605:cf7322cb1c13 19606:284f91230c07
548 pl[0] = (r[0], r[1], None) 548 pl[0] = (r[0], r[1], None)
549 549
550 return [filectx(self._repo, p, fileid=n, filelog=l) 550 return [filectx(self._repo, p, fileid=n, filelog=l)
551 for p, n, l in pl if n != nullid] 551 for p, n, l in pl if n != nullid]
552 552
553 def p1(self):
554 return self.parents()[0]
555
553 class filectx(basefilectx): 556 class filectx(basefilectx):
554 """A filecontext object makes access to data related to a particular 557 """A filecontext object makes access to data related to a particular
555 filerevision convenient.""" 558 filerevision convenient."""
556 def __init__(self, repo, path, changeid=None, fileid=None, 559 def __init__(self, repo, path, changeid=None, fileid=None,
557 filelog=None, changectx=None): 560 filelog=None, changectx=None):
632 if fnode == p.filenode(name): 635 if fnode == p.filenode(name):
633 return None 636 return None
634 except error.LookupError: 637 except error.LookupError:
635 pass 638 pass
636 return renamed 639 return renamed
637
638 def p1(self):
639 return self.parents()[0]
640 640
641 def p2(self): 641 def p2(self):
642 p = self.parents() 642 p = self.parents()
643 if len(p) == 2: 643 if len(p) == 2:
644 return p[1] 644 return p[1]