[PATCH 35 of 41] basefilectx: move p1 from filectx

Sean Farley sean.michael.farley at gmail.com
Mon Aug 12 11:27:31 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376279950 18000
#      Sun Aug 11 22:59:10 2013 -0500
# Node ID 3f092041ba827e9e278d4e1d3d6fdad2d3cd8c7c
# Parent  4e5188a63e0fc6700f002930d542a8e0af2b8881
basefilectx: move p1 from filectx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -548,10 +548,13 @@
             pl[0] = (r[0], r[1], None)
 
         return [filectx(self._repo, p, fileid=n, filelog=l)
                 for p, n, l in pl if n != nullid]
 
+    def p1(self):
+        return self.parents()[0]
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
     def __init__(self, repo, path, changeid=None, fileid=None,
                  filelog=None, changectx=None):
@@ -633,13 +636,10 @@
                     return None
             except error.LookupError:
                 pass
         return renamed
 
-    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)


More information about the Mercurial-devel mailing list