changeset 38335:8783f128048e

fileset: raise ProgrammingError for bad existing() calls And glob out Py2/3 difference.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Jun 2018 17:00:05 +0900
parents 5cb39a368c80
children 62376d7b8859
files mercurial/fileset.py tests/test-fileset.t
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Sat Jun 16 16:56:38 2018 +0900
+++ b/mercurial/fileset.py	Sat Jun 16 17:00:05 2018 +0900
@@ -566,7 +566,8 @@
     def filter(self, files):
         return [f for f in files if f in self.subset]
     def existing(self):
-        assert self._existingenabled, 'unexpected existing() invocation'
+        if not self._existingenabled:
+            raise error.ProgrammingError('unexpected existing() invocation')
         if self._status is not None:
             removed = set(self._status[3])
             unknown = set(self._status[4] + self._status[5])
--- a/tests/test-fileset.t	Sat Jun 16 16:56:38 2018 +0900
+++ b/tests/test-fileset.t	Sat Jun 16 17:00:05 2018 +0900
@@ -446,7 +446,7 @@
   > EOF
 
   $ fileset 'existingcaller()' 2>&1 | tail -1
-  AssertionError: unexpected existing() invocation
+  *ProgrammingError: *unexpected existing() invocation* (glob)
 
 Test 'revs(...)'
 ================