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

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <c1985b5d707dcef32041.1378411648@laptop.local>
Download mbox | patch
Permalink /patch/2374/
State Accepted
Commit 33ae2052d924278e44715e7ffb74f8eb6e57ffa7
Headers show

Comments

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

Patch

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