comparison mercurial/match.py @ 32444:57d6c0c74b1b

match: use ProgrammingError where appropriate
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 23 May 2017 08:49:01 -0700
parents 9695aca1a3a0
children a04bc55201c3
comparison
equal deleted inserted replaced
32443:34e9b8b94f66 32444:57d6c0c74b1b
36 other = [] 36 other = []
37 37
38 for kind, pat, source in kindpats: 38 for kind, pat, source in kindpats:
39 if kind == 'set': 39 if kind == 'set':
40 if not ctx: 40 if not ctx:
41 raise error.Abort(_("fileset expression with no context")) 41 raise error.ProgrammingError("fileset expression with no "
42 "context")
42 s = ctx.getfileset(pat) 43 s = ctx.getfileset(pat)
43 fset.update(s) 44 fset.update(s)
44 45
45 if listsubrepos: 46 if listsubrepos:
46 for subpath in ctx.substate: 47 for subpath in ctx.substate:
119 '<something>' - a pattern of the specified default type 120 '<something>' - a pattern of the specified default type
120 """ 121 """
121 normalize = _donormalize 122 normalize = _donormalize
122 if icasefs: 123 if icasefs:
123 if exact: 124 if exact:
124 raise error.Abort(_("a case-insensitive exact matcher doesn't " 125 raise error.ProgrammingError("a case-insensitive exact matcher "
125 "make sense")) 126 "doesn't make sense")
126 dirstate = ctx.repo().dirstate 127 dirstate = ctx.repo().dirstate
127 dsnormalize = dirstate.normalize 128 dsnormalize = dirstate.normalize
128 129
129 def normalize(patterns, default, root, cwd, auditor, warn): 130 def normalize(patterns, default, root, cwd, auditor, warn):
130 kp = _donormalize(patterns, default, root, cwd, auditor, warn) 131 kp = _donormalize(patterns, default, root, cwd, auditor, warn)