# HG changeset patch # User Matt Harbison # Date 1435512137 14400 # Node ID 0f894d2203c8f513c35e08df5aa9266de7d0e1ef # Parent 3b1fc40626d8b13424b8158352edff81cc7517cd identify: build the tag list directly instead of using wctx.tags() The current implementation of workingctx.tags() returns the tags of the parents. This causes the calculation of {lastesttagdistance} from wdir() to be wrong. The value when updated to a tag is 0, but updated to the tag's child is 2, the child of that 3, and so on. This prepares for workingctx.tags() to not report the parent tags. diff -r 3b1fc40626d8 -r 0f894d2203c8 mercurial/commands.py --- a/mercurial/commands.py Sun Jun 28 18:39:58 2015 -0400 +++ b/mercurial/commands.py Sun Jun 28 13:22:17 2015 -0400 @@ -4069,6 +4069,10 @@ if ctx.rev() is None: ctx = repo[None] parents = ctx.parents() + taglist = [] + for p in parents: + taglist.extend(p.tags()) + changed = "" if default or id or num: if (any(repo.status()) @@ -4085,6 +4089,7 @@ output = [hexfunc(ctx.node())] if num: output.append(str(ctx.rev())) + taglist = ctx.tags() if default and not ui.quiet: b = ctx.branch() @@ -4092,7 +4097,7 @@ output.append("(%s)" % b) # multiple tags for a single parent separated by '/' - t = '/'.join(ctx.tags()) + t = '/'.join(taglist) if t: output.append(t) @@ -4105,7 +4110,7 @@ output.append(ctx.branch()) if tags: - output.extend(ctx.tags()) + output.extend(taglist) if bookmarks: output.extend(ctx.bookmarks())