Patchwork [20,of,35,V2] context: move parents from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 11:51 p.m.
Message ID <ca49bea0b803d7f6f997.1375919494@laptop.local>
Download mbox | patch
Permalink /patch/2073/
State Accepted
Headers show

Comments

Sean Farley - Aug. 7, 2013, 11:51 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375744778 18000
#      Mon Aug 05 18:19:38 2013 -0500
# Node ID ca49bea0b803d7f6f9973ebf2d6c25b12f7a0f2d
# Parent  cf7078fa93e534974b529e70e31ecb00d9927c23
context: move parents from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -78,10 +78,14 @@ 
     def phasestr(self):
         return phases.phasenames[self.phase()]
     def mutable(self):
         return self.phase() > phases.public
 
+    def parents(self):
+        """return contexts for each parent changeset"""
+        return self._parents
+
 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=''):
@@ -239,14 +243,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 parents(self):
-        """return contexts for each parent changeset"""
-        return self._parents
-
     def p1(self):
         return self._parents[0]
 
     def p2(self):
         if len(self._parents) == 2: