changeset 25688:24cda1dd45ff

workingctx: don't report the tags for its parents This fixes the bad distance calculation for '{latesttagdistance}' mentioned in the previous patch.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 28 Jun 2015 13:38:03 -0400
parents 984b4554ddf7
children 1cce81121472
files mercurial/context.py tests/test-log.t tests/test-tag.t
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue Jun 30 23:34:12 2015 +0800
+++ b/mercurial/context.py	Sun Jun 28 13:38:03 2015 -0400
@@ -1247,10 +1247,7 @@
         return self._extra
 
     def tags(self):
-        t = []
-        for p in self.parents():
-            t.extend(p.tags())
-        return t
+        return []
 
     def bookmarks(self):
         b = []
--- a/tests/test-log.t	Tue Jun 30 23:34:12 2015 +0800
+++ b/tests/test-log.t	Sun Jun 28 13:38:03 2015 -0400
@@ -1653,7 +1653,7 @@
     "date": [*, 0], (glob)
     "desc": "",
     "bookmarks": [],
-    "tags": ["tip"],
+    "tags": [],
     "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"]
    }
   ]
@@ -1677,7 +1677,7 @@
     "date": [*, 0], (glob)
     "desc": "",
     "bookmarks": [],
-    "tags": ["tip"],
+    "tags": [],
     "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
     "manifest": null,
     "extra": {"branch": "default"},
--- a/tests/test-tag.t	Tue Jun 30 23:34:12 2015 +0800
+++ b/tests/test-tag.t	Sun Jun 28 13:38:03 2015 -0400
@@ -416,6 +416,12 @@
   $ hg ci -A -m0
   adding f0
   $ hg tag tbase
+  $ hg up -qr '.^'
+  $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
+  1
+  $ hg up -q
+  $ hg log -r 'wdir()' -T "{latesttagdistance}\n"
+  2
   $ cd ..
   $ hg clone repo-automatic-tag-merge repo-automatic-tag-merge-clone
   updating to branch default