[PATCH] commands: print tags to unknown nodes

Matt Mackall mpm at selenic.com
Mon Apr 4 14:08:26 CDT 2011


On Mon, 2011-04-04 at 21:21 +0300, Idan Kamara wrote:
> # HG changeset patch
> # User Idan Kamara <idankk86 at gmail.com>
> # Date 1301940970 -10800
> # Node ID 197a698fd249c0cfdcecf2c4b128ea8b674cd91a
> # Parent  6b964249593693135e6a8c1193f65dd411ae2003
> commands: print tags to unknown nodes
> 
> This restores (very) old behaviour that was changed (accidently?) in ae3089cefaab

It does look like that was an accidental change.

However, I'm not really sure we particularly want to report these
unknown/invalid tags at all.

> diff -r 6b9642495936 -r 197a698fd249 mercurial/commands.py
> --- a/mercurial/commands.py	Mon Apr 04 19:06:02 2011 +0300
> +++ b/mercurial/commands.py	Mon Apr 04 21:16:10 2011 +0300
> @@ -4065,14 +4065,15 @@
>              r = "%5d:%s" % (repo.changelog.rev(n), hn)
>          except error.LookupError:
>              r = "    ?:%s" % hn
> -        else:
> -            spaces = " " * (30 - encoding.colwidth(t))
> -            if ui.verbose:
> -                if repo.tagtype(t) == 'local':
> -                    tagtype = " local"
> -                else:
> -                    tagtype = ""
> -            ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
> +
> +        spaces = " " * (30 - encoding.colwidth(t))
> +
> +        if ui.verbose:
> +            if repo.tagtype(t) == 'local':
> +                tagtype = " local"
> +            else:
> +                tagtype = ""
> +        ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
>  
>  def tip(ui, repo, **opts):
>      """show the tip revision
> diff -r 6b9642495936 -r 197a698fd249 tests/test-tags.t
> --- a/tests/test-tags.t	Mon Apr 04 19:06:02 2011 +0300
> +++ b/tests/test-tags.t	Mon Apr 04 21:16:10 2011 +0300
> @@ -158,6 +158,7 @@
>    .hgtags at c4be69a18c11, line 2: node 'x' is not well formed
>    tip                                8:c4be69a18c11
>    first                              0:acb14030fe0a
> +  invalid                            ?:a5a5
>    $ hg tip
>    changeset:   8:c4be69a18c11
>    tag:         tip
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list