[PATCH 2 of 2] histedit: use str.startswith to check for comments in action list

Matt Mackall mpm at selenic.com
Tue Aug 26 05:00:03 CDT 2014


On Fri, 2014-08-22 at 16:47 -0400, adgar at google.com wrote:
> # HG changeset patch
> # User Mike Edgar <adgar at google.com>
> # Date 1408740034 14400
> #      Fri Aug 22 16:40:34 2014 -0400
> # Node ID df02780e56f269f41442dc4c7b98776dada7d8ff
> # Parent  3e73eb37f5c8b6a837983c5f9d505ac4cfade546
> histedit: use str.startswith to check for comments in action list
> 
> diff -r 3e73eb37f5c8 -r df02780e56f2 hgext/histedit.py
> --- a/hgext/histedit.py	Fri Aug 22 16:37:55 2014 -0400
> +++ b/hgext/histedit.py	Fri Aug 22 16:40:34 2014 -0400
> @@ -610,7 +610,7 @@
>              rules = f.read()
>              f.close()
>          rules = [l for l in (r.strip() for r in rules.splitlines())
> -                 if l and not l[0] == '#']
> +                 if not l.startswith('#')]

FYI, this obviously-correct change breaks seven tests! You might find
run-tests.py -k histedit helpful.

Looks like the "l and" piece is actually doing more than it looks like,
I've added it back in flight.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list