Patchwork [2,of,2] match: remove matchessubrepo method

login
register
mail settings
Submitter Hannes Oldenburg
Date Aug. 16, 2016, 3:42 p.m.
Message ID <1dc53807ae73733ab565.1471362154@localhost.localdomain>
Download mbox | patch
Permalink /patch/16324/
State Accepted
Headers show

Comments

Hannes Oldenburg - Aug. 16, 2016, 3:42 p.m.
# HG changeset patch
# User Hannes Oldenburg <hannes.christian.oldenburg@gmail.com>
# Date 1471335676 0
#      Tue Aug 16 08:21:16 2016 +0000
# Node ID 1dc53807ae73733ab5655e22f56ccf99ab7688ff
# Parent  ad4abe10145930a1067660221fb8e06bb5d03995
match: remove matchessubrepo method

Since it is no more used in cmdutil.{files,remove} and scmutil.addremove
we remove this method.
Augie Fackler - Aug. 17, 2016, 3:22 p.m.
On Tue, Aug 16, 2016 at 03:42:34PM +0000, Hannes Oldenburg wrote:
> # HG changeset patch
> # User Hannes Oldenburg <hannes.christian.oldenburg@gmail.com>
> # Date 1471335676 0
> #      Tue Aug 16 08:21:16 2016 +0000
> # Node ID 1dc53807ae73733ab5655e22f56ccf99ab7688ff
> # Parent  ad4abe10145930a1067660221fb8e06bb5d03995
> match: remove matchessubrepo method

Queued these, nice cleanup. Thanks!

>
> Since it is no more used in cmdutil.{files,remove} and scmutil.addremove
> we remove this method.
>
> diff -r ad4abe101459 -r 1dc53807ae73 mercurial/match.py
> --- a/mercurial/match.py	Tue Aug 16 08:15:12 2016 +0000
> +++ b/mercurial/match.py	Tue Aug 16 08:21:16 2016 +0000
> @@ -320,10 +320,6 @@
>              kindpats.append((kind, pat, ''))
>          return kindpats
>
> -    def matchessubrepo(self, subpath):
> -        return (self.exact(subpath)
> -                or any(f.startswith(subpath + '/') for f in self.files()))
> -
>  def exact(root, cwd, files, badfn=None):
>      return match(root, cwd, files, exact=True, badfn=badfn)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r ad4abe101459 -r 1dc53807ae73 mercurial/match.py
--- a/mercurial/match.py	Tue Aug 16 08:15:12 2016 +0000
+++ b/mercurial/match.py	Tue Aug 16 08:21:16 2016 +0000
@@ -320,10 +320,6 @@ 
             kindpats.append((kind, pat, ''))
         return kindpats
 
-    def matchessubrepo(self, subpath):
-        return (self.exact(subpath)
-                or any(f.startswith(subpath + '/') for f in self.files()))
-
 def exact(root, cwd, files, badfn=None):
     return match(root, cwd, files, exact=True, badfn=badfn)