workingctx: don't report the tags for its parents
This fixes the bad distance calculation for '{latesttagdistance}' mentioned in
the previous patch.
--- 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