[PATCH 2 of 2] summary: indicate the current bookmark with '*'

Matt Mackall mpm at selenic.com
Tue Jun 22 10:31:13 CDT 2010


On Mon, 2010-06-21 at 17:58 -0400, Cesar Mena wrote:
> # HG changeset patch
> # User Cesar Mena <cmena at pobox.com>
> # Date 1277155241 14400
> # Node ID 99431fbd97c234ee9166414d018fc189bb41c0ff
> # Parent  a5d8bceda56cad38b105d30a08d19569fcfbbb37
> summary: indicate the current bookmark with '*'
> 
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -3469,6 +3469,11 @@
>  
>      Returns 0 on success.
>      """
> +    def fmttag(t):
> +        if repo.tagtype(t) == 'bookmark':
> +            if repo._bookmarkcurrent == t:
> +                t = '*' + t
> +        return t

This is a HUGE layering violation. Nothing in the Mercurial directory
should have any awareness of anything in the hgext/ directory. Knowledge
of bookmarks should be entirely restricted to the bookmarks extension
itself.

And indeed, this code will give a traceback if the bookmark extension
isn't enabled (ie the default configuration).

Also, we're in the middle of a code freeze for 1.6, please wait until
after July 1 to submit new feature patches.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list