[PATCH 1 of 2] workingctx: overload bookmarks() to return parents' bookmarks

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Feb 23 20:48:23 CST 2011


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1298515620 21600
# Branch stable
# Node ID 0357458cca79624d79a84896067c43020e5170a5
# Parent  31aa2e5b07501ddcfd781e6a833db018fef46210
workingctx: overload bookmarks() to return parents' bookmarks

This implements workingctx.bookmarks() parallel to workingctx.tags(),
overloading the implementation from changectx.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -726,6 +726,12 @@
             t.extend(p.tags())
         return t
 
+    def bookmarks(self):
+        b = []
+        for p in self.parents():
+            b.extend(p.bookmarks())
+        return b
+
     def children(self):
         return []
 


More information about the Mercurial-devel mailing list