[PATCH 2 of 5 STABLE V2] largefiles: exit from remove with 1 on warnings

Greg Ward greg at gerg.ca
Thu Sep 13 09:33:55 CDT 2012


On 09 September 2012, Matt Harbison said:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1347236288 14400
> # Branch stable
> # Node ID 00f98c03da14cea6a56cd664f91848ac07ddd78a
> # Parent  38f17c53cdaa924161b49ae92d5b82cb225f4f89
> largefiles: exit from remove with 1 on warnings
> 
> This maintains the exit codes documented in commands.py.
> 
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -141,14 +141,17 @@
>          for f in files:
>              ui.warn(_('not removing %s: %s (use forget to undo)\n')
>                      % (m.rel(f), reason))
> +        return int(len(files)>0)

Whitespace around binary operators, please: "int(len(files) > 0)".
(Not entirely your fault: I think I screwed it up when I typed that
originally. Ooops!)

http://www.python.org/dev/peps/pep-0008/#other-recommendations

-- 
Greg Ward                                http://www.gerg.ca/
A day without sunshine is like night.


More information about the Mercurial-devel mailing list