Patchwork [21,of,36] context: move p1 from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 6:13 p.m.
Message ID <02e9a78aa148940036c0.1375899201@laptop.local>
Download mbox | patch
Permalink /patch/2038/
State Superseded
Commit 4651234daa7326d7054c877e83a5dc8325473596
Delegated to: Augie Fackler
Headers show

Comments

Sean Farley - Aug. 7, 2013, 6:13 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375745175 18000
#      Mon Aug 05 18:26:15 2013 -0500
# Node ID 02e9a78aa148940036c09266782e8866c4cecc96
# Parent  61bc54b101e10e9534e6b328ff8369e361c4296d
context: move p1 from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -82,10 +82,13 @@ 
 
     def parents(self):
         """return contexts for each parent changeset"""
         return self._parents
 
+    def p1(self):
+        return self._parents[0]
+
 class changectx(context):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
     the repo."""
     def __init__(self, repo, changeid=''):
@@ -237,13 +240,10 @@ 
     def phase(self):
         return self._repo._phasecache.phase(self._repo, self._rev)
     def hidden(self):
         return self._rev in repoview.filterrevs(self._repo, 'visible')
 
-    def p1(self):
-        return self._parents[0]
-
     def p2(self):
         if len(self._parents) == 2:
             return self._parents[1]
         return changectx(self._repo, -1)