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

login
register
mail settings
Submitter Sean Farley
Date Sept. 5, 2013, 8:07 p.m.
Message ID <2c15df7257a82956162c.1378411647@laptop.local>
Download mbox | patch
Permalink /patch/2371/
State Accepted
Commit 65ff9fd67d8d4b324504589192a9f43150e262a4
Headers show

Comments

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

Patch

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