[PATCH 33 of 48 RFC] commitablectx: move tags from workingctx

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


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

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -992,10 +992,16 @@
     def closesbranch(self):
         return 'close' in self._extra
     def extra(self):
         return self._extra
 
+    def tags(self):
+        t = []
+        for p in self.parents():
+            t.extend(p.tags())
+        return t
+
 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.
@@ -1018,16 +1024,10 @@
         p = self._repo.dirstate.parents()
         if p[1] == nullid:
             p = p[:-1]
         return [changectx(self._repo, x) for x in p]
 
-    def tags(self):
-        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


More information about the Mercurial-devel mailing list