Patchwork histedit: remove unused variable state

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 31, 2015, 3:40 p.m.
Message ID <5f94f7753cf06bc1c852.1451576456@waste.org>
Download mbox | patch
Permalink /patch/12446/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 31, 2015, 3:40 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1451576378 0
#      Thu Dec 31 15:39:38 2015 +0000
# Node ID 5f94f7753cf06bc1c85209e97aa6591d0c1b0b49
# Parent  44f717c879033f28d3f7e7dc9f34aa394d2fea3f
histedit: remove unused variable state
Augie Fackler - Dec. 31, 2015, 4:56 p.m.
> On Dec 31, 2015, at 10:40 AM, timeless <timeless@mozdev.org> wrote:
> 
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1451576378 0
> #      Thu Dec 31 15:39:38 2015 +0000
> # Node ID 5f94f7753cf06bc1c85209e97aa6591d0c1b0b49
> # Parent  44f717c879033f28d3f7e7dc9f34aa394d2fea3f
> histedit: remove unused variable state

I’ll queue this, but you should split out your errant check-code bits which look righteous as well.

> 
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -127,6 +127,7 @@
>     (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"),
>     (r'\butil\.Abort\b', "directly use error.Abort"),
>     (r'\|&', "don't use |&, use 2>&1"),
> +    (r'\w =  \w', "don't use two spaces after equals"),
>   ],
>   # warnings
>   [
> @@ -220,6 +221,7 @@
>     (r'(\w|\)),\w', "missing whitespace after ,"),
>     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
>     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
> +    (r'\w\s=\s\s\w', "superfluous whitespace in assignment"),
>     (r'.{81}', "line too long"),
>     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
>     (r'[^\n]\Z', "no trailing newline"),
> @@ -337,6 +339,7 @@
>     (r'\w+ (\+\+|--)', "use foo++, not foo ++"),
>     (r'\w,\w', "missing whitespace after ,"),
>     (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
> +    (r'\w\s=\s\s\w', "superfluous whitespace in assignment"),
>     (r'^#\s+\w', "use #foo, not # foo"),
>     (r'[^\n]\Z', "no trailing newline"),
>     (r'^\s*#import\b', "use only #include in standard C code"),
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -629,7 +629,6 @@
>         """ Verifies semantic correctness of the fold rule"""
>         super(fold, self).verify(prev)
>         repo = self.repo
> -        state = self.state
>         if not prev:
>             c = repo[self.node].parents()[0]
>         elif not prev.verb in ('pick', 'base'):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -127,6 +127,7 @@ 
     (r'seq ', "don't use 'seq', use $TESTDIR/seq.py"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
     (r'\|&', "don't use |&, use 2>&1"),
+    (r'\w =  \w', "don't use two spaces after equals"),
   ],
   # warnings
   [
@@ -220,6 +221,7 @@ 
     (r'(\w|\)),\w', "missing whitespace after ,"),
     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
+    (r'\w\s=\s\s\w', "superfluous whitespace in assignment"),
     (r'.{81}', "line too long"),
     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
     (r'[^\n]\Z', "no trailing newline"),
@@ -337,6 +339,7 @@ 
     (r'\w+ (\+\+|--)', "use foo++, not foo ++"),
     (r'\w,\w', "missing whitespace after ,"),
     (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
+    (r'\w\s=\s\s\w', "superfluous whitespace in assignment"),
     (r'^#\s+\w', "use #foo, not # foo"),
     (r'[^\n]\Z', "no trailing newline"),
     (r'^\s*#import\b', "use only #include in standard C code"),
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -629,7 +629,6 @@ 
         """ Verifies semantic correctness of the fold rule"""
         super(fold, self).verify(prev)
         repo = self.repo
-        state = self.state
         if not prev:
             c = repo[self.node].parents()[0]
         elif not prev.verb in ('pick', 'base'):