[PATCH remotenames-ext] bookmarks: adopt the formatter isplain method

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Oct 3 12:29:07 EDT 2016


> On Oct 3, 2016, at 10:48, Kostia Balytskyi <ikostia at fb.com> wrote:
> 
> # HG changeset patch
> # User Kostia Balytskyi <ikostia at fb.com>
> # Date 1475508913 25200
> #      Mon Oct 03 08:35:13 2016 -0700
> # Node ID bc204ce8544ee98aed0119cbf5eec6a3618bf0db
> # Parent  e4c0713ea86204b900a2e1cce238f61e4bef2062
> bookmarks: adopt the formatter isplain method
> 
> Main hg repo changed the way formatter is supposed to be checked for
> plainness: previously people would run `if not fm`, thus relying on
> `__nonzero__` method, but now there is `isplain` method of formatter.
> Remotenames needs to adopt it.
> 
> diff --git a/remotenames.py b/remotenames.py
> --- a/remotenames.py
> +++ b/remotenames.py
> @@ -1047,7 +1047,7 @@ def displaylocalbookmarks(ui, repo, opts
>     fm = ui.formatter('bookmarks', opts)
>     hexfn = fm.hexfunc
>     marks = repo._bookmarks
> -    if len(marks) == 0 and not fm:
> +    if len(marks) == 0 and (not fm or  fm.isplain()):
Nit: extra space here ------------------^

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list