Patchwork [2,of,2,V2] crecord: drop unused "operation" parameter from filterpatch function

login
register
mail settings
Submitter Denis Laxalde
Date June 7, 2016, 11:55 a.m.
Message ID <3f890304e34ed182142f.1465300534@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/15429/
State Accepted
Headers show

Comments

Denis Laxalde - June 7, 2016, 11:55 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1465293431 -7200
#      Tue Jun 07 11:57:11 2016 +0200
# Node ID 3f890304e34ed182142ff5017406b4eb088b0d0d
# Parent  608c9db1b99f36e3857c2e4081c5d6629aae8bab
crecord: drop unused "operation" parameter from filterpatch function
Yuya Nishihara - June 8, 2016, 2:08 p.m.
On Tue, 07 Jun 2016 13:55:34 +0200, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@logilab.fr>
> # Date 1465293431 -7200
> #      Tue Jun 07 11:57:11 2016 +0200
> # Node ID 3f890304e34ed182142ff5017406b4eb088b0d0d
> # Parent  608c9db1b99f36e3857c2e4081c5d6629aae8bab
> crecord: drop unused "operation" parameter from filterpatch function
> 
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -83,7 +83,7 @@ def filterchunks(ui, originalhunks, usec
>          else:
>              recordfn = crecordmod.chunkselector
>  
> -        return crecordmod.filterpatch(ui, originalhunks, recordfn, operation)
> +        return crecordmod.filterpatch(ui, originalhunks, recordfn)
>  
>      else:
>          return patch.filterpatch(ui, originalhunks, operation)
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -440,11 +440,8 @@ class uihunk(patchnode):
>      def __repr__(self):
>          return '<hunk %r@%d>' % (self.filename(), self.fromline)
>  
> -def filterpatch(ui, chunks, chunkselector, operation=None):
> +def filterpatch(ui, chunks, chunkselector):
>      """interactively filter patch chunks into applied-only chunks"""
> -
> -    if operation is None:
> -        operation = _('confirm')

This "operation" parameter might be planned to be used, but the default value
_('confirm') is getting wrong and unclear today. So it makes sense to me to
drop this parameter.

Pushed to the committed repo, thanks.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -83,7 +83,7 @@  def filterchunks(ui, originalhunks, usec
         else:
             recordfn = crecordmod.chunkselector
 
-        return crecordmod.filterpatch(ui, originalhunks, recordfn, operation)
+        return crecordmod.filterpatch(ui, originalhunks, recordfn)
 
     else:
         return patch.filterpatch(ui, originalhunks, operation)
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -440,11 +440,8 @@  class uihunk(patchnode):
     def __repr__(self):
         return '<hunk %r@%d>' % (self.filename(), self.fromline)
 
-def filterpatch(ui, chunks, chunkselector, operation=None):
+def filterpatch(ui, chunks, chunkselector):
     """interactively filter patch chunks into applied-only chunks"""
-
-    if operation is None:
-        operation = _('confirm')
     chunks = list(chunks)
     # convert chunks list into structure suitable for displaying/modifying
     # with curses.  create a list of headers only.