Patchwork [2,of,2] match: remove unused assignment of ctx

login
register
mail settings
Submitter Yuya Nishihara
Date March 25, 2015, 12:16 p.m.
Message ID <16b7fe3da7bad2a9ebff.1427285774@mimosa>
Download mbox | patch
Permalink /patch/8259/
State Accepted
Commit 7797fadac0e8ca1677ebdddeef3b407c043a705f
Headers show

Comments

Yuya Nishihara - March 25, 2015, 12:16 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1421465984 -32400
#      Sat Jan 17 12:39:44 2015 +0900
# Node ID 16b7fe3da7bad2a9ebffe55d8745fb75e4b1db12
# Parent  fc35f6b8a2365bcdb143b5d6dfbf3707517f96c5
match: remove unused assignment of ctx

ctx is consumed in __init__ to build match patterns and never used after that.
Martin von Zweigbergk - March 25, 2015, 4:31 p.m.
This looks good to me. I've pushed the series to the clowncopter.

On Wed, Mar 25, 2015 at 5:18 AM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1421465984 -32400
> #      Sat Jan 17 12:39:44 2015 +0900
> # Node ID 16b7fe3da7bad2a9ebffe55d8745fb75e4b1db12
> # Parent  fc35f6b8a2365bcdb143b5d6dfbf3707517f96c5
> match: remove unused assignment of ctx
>
> ctx is consumed in __init__ to build match patterns and never used after
> that.
>
> diff --git a/mercurial/match.py b/mercurial/match.py
> --- a/mercurial/match.py
> +++ b/mercurial/match.py
> @@ -63,7 +63,6 @@ class match(object):
>          self._cwd = cwd
>          self._files = [] # exact files and roots of patterns
>          self._anypats = bool(include or exclude)
> -        self._ctx = ctx
>          self._always = False
>          self._pathrestricted = bool(include or exclude or patterns)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -63,7 +63,6 @@  class match(object):
         self._cwd = cwd
         self._files = [] # exact files and roots of patterns
         self._anypats = bool(include or exclude)
-        self._ctx = ctx
         self._always = False
         self._pathrestricted = bool(include or exclude or patterns)