Patchwork match: remove ispartial()

login
register
mail settings
Submitter via Mercurial-devel
Date May 17, 2017, 10:01 p.m.
Message ID <26e0ebdb7d88779011da.1495058512@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20666/
State Accepted
Headers show

Comments

via Mercurial-devel - May 17, 2017, 10:01 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495039430 25200
#      Wed May 17 09:43:50 2017 -0700
# Node ID 26e0ebdb7d88779011da54039309ba22b8179ef0
# Parent  2d19664e257da7ad5cb97150d81838c25872fac7
match: remove ispartial()

The function was added in d1d69ca78883 (match: add match.ispartial(),
2015-05-15) for use by narrowhg, but narrowhg never ended up needing
it.
Yuya Nishihara - May 18, 2017, 2:11 p.m.
On Wed, 17 May 2017 15:01:52 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1495039430 25200
> #      Wed May 17 09:43:50 2017 -0700
> # Node ID 26e0ebdb7d88779011da54039309ba22b8179ef0
> # Parent  2d19664e257da7ad5cb97150d81838c25872fac7
> match: remove ispartial()

Queued, thanks.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1575,7 +1575,7 @@ 
             wctx = self[None]
             merge = len(wctx.parents()) > 1
 
-            if not force and merge and match.ispartial():
+            if not force and merge and not match.always():
                 raise error.Abort(_('cannot partially commit a merge '
                                    '(do not specify files or patterns)'))
 
diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -281,14 +281,6 @@ 
         - optimization might be possible and necessary.'''
         return self._always
 
-    def ispartial(self):
-        '''True if the matcher won't always match.
-
-        Although it's just the inverse of _always in this implementation,
-        an extension such as narrowhg might make it return something
-        slightly different.'''
-        return not self._always
-
     def isexact(self):
         return self.matchfn == self.exact