[PATCH 34 of 48 RFC] commitablectx: move bookmarks from workingctx

Sean Farley sean.michael.farley at gmail.com
Thu Sep 5 15:07:28 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376515473 18000
#      Wed Aug 14 16:24:33 2013 -0500
# Node ID c1985b5d707dcef3204119ff14de74a85002e2ba
# Parent  2c15df7257a82956162cb82bbe29ddfca0ed32dd
commitablectx: move bookmarks from workingctx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -998,10 +998,16 @@
         t = []
         for p in self.parents():
             t.extend(p.tags())
         return t
 
+    def bookmarks(self):
+        b = []
+        for p in self.parents():
+            b.extend(p.bookmarks())
+        return b
+
 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.
@@ -1024,16 +1030,10 @@
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def bookmarks(self):
-        b = []
-        for p in self.parents():
-            b.extend(p.bookmarks())
-        return b
-
     def phase(self):
         phase = phases.draft # default phase to draft
         for p in self.parents():
             phase = max(phase, p.phase())
         return phase


More information about the Mercurial-devel mailing list