Patchwork [39,of,48,RFC] commitablectx: move ancestor from workingctx

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <7274902311f15774b62a.1378411653@laptop.local>
Download mbox | patch
Permalink /patch/2377/
State Accepted
Commit 210cc42a8ac2ff556e70d6813c170157eb2b41be
Headers show

Comments

Sean Farley - Sept. 5, 2013, 8:07 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1376516221 18000
#      Wed Aug 14 16:37:01 2013 -0500
# Node ID 7274902311f15774b62a035f498ccf296062d306
# Parent  71c828371ffd75b706a037f860ed82ae5d67d1c0
commitablectx: move ancestor from workingctx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1028,10 +1028,14 @@ 
         try:
             return self._flagfunc(path)
         except OSError:
             return ''
 
+    def ancestor(self, c2):
+        """return the ancestor context of self and c2"""
+        return self._parents[0].ancestor(c2) # punt on two parents for now
+
 class workingctx(commitablectx):
     """A workingctx object makes access to data related to
     the current working directory convenient.
     date - any valid date string or (unixtime, offset), or None.
     user - username string, or None.
@@ -1059,14 +1063,10 @@ 
     def filectx(self, path, filelog=None):
         """get a file context from the working directory"""
         return workingfilectx(self._repo, path, workingctx=self,
                               filelog=filelog)
 
-    def ancestor(self, c2):
-        """return the ancestor context of self and c2"""
-        return self._parents[0].ancestor(c2) # punt on two parents for now
-
     def walk(self, match):
         return sorted(self._repo.dirstate.walk(match, sorted(self.substate),
                                                True, False))
 
     def dirty(self, missing=False, merge=True, branch=True):