changeset 19607:056a949799ac

basefilectx: move p2 from filectx
author Sean Farley <sean.michael.farley@gmail.com>
date Sun, 11 Aug 2013 23:00:11 -0500
parents 284f91230c07
children 896193a9cab4
files mercurial/context.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Sun Aug 11 22:59:10 2013 -0500
+++ b/mercurial/context.py	Sun Aug 11 23:00:11 2013 -0500
@@ -553,6 +553,12 @@
     def p1(self):
         return self.parents()[0]
 
+    def p2(self):
+        p = self.parents()
+        if len(p) == 2:
+            return p[1]
+        return filectx(self._repo, self._path, fileid=-1, filelog=self._filelog)
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
@@ -638,12 +644,6 @@
                 pass
         return renamed
 
-    def p2(self):
-        p = self.parents()
-        if len(p) == 2:
-            return p[1]
-        return filectx(self._repo, self._path, fileid=-1, filelog=self._filelog)
-
     def children(self):
         # hard for renames
         c = self._filelog.children(self._filenode)