equal
deleted
inserted
replaced
2152 if pos != len(value): |
2152 if pos != len(value): |
2153 raise error.ParseError(_('invalid token'), pos) |
2153 raise error.ParseError(_('invalid token'), pos) |
2154 # Check for placeholder injection |
2154 # Check for placeholder injection |
2155 _checkaliasarg(self.replacement, self.args) |
2155 _checkaliasarg(self.replacement, self.args) |
2156 except error.ParseError, inst: |
2156 except error.ParseError, inst: |
2157 self.error = parseerrordetail(inst) |
2157 self.error = _('failed to parse the definition of revset alias' |
|
2158 ' "%s": %s') % (self.name, parseerrordetail(inst)) |
2158 |
2159 |
2159 def _getalias(aliases, tree): |
2160 def _getalias(aliases, tree): |
2160 """If tree looks like an unexpanded alias, return it. Return None |
2161 """If tree looks like an unexpanded alias, return it. Return None |
2161 otherwise. |
2162 otherwise. |
2162 """ |
2163 """ |
2195 # Do not expand raw strings |
2196 # Do not expand raw strings |
2196 return tree |
2197 return tree |
2197 alias = _getalias(aliases, tree) |
2198 alias = _getalias(aliases, tree) |
2198 if alias is not None: |
2199 if alias is not None: |
2199 if alias.error: |
2200 if alias.error: |
2200 raise util.Abort(_('failed to parse revset alias "%s": %s') % |
2201 raise util.Abort(alias.error) |
2201 (alias.name, alias.error)) |
|
2202 if alias in expanding: |
2202 if alias in expanding: |
2203 raise error.ParseError(_('infinite expansion of revset alias "%s" ' |
2203 raise error.ParseError(_('infinite expansion of revset alias "%s" ' |
2204 'detected') % alias.name) |
2204 'detected') % alias.name) |
2205 expanding.append(alias) |
2205 expanding.append(alias) |
2206 if alias.name not in cache: |
2206 if alias.name not in cache: |
2229 tree = _expandaliases(aliases, tree, [], {}) |
2229 tree = _expandaliases(aliases, tree, [], {}) |
2230 if showwarning: |
2230 if showwarning: |
2231 # warn about problematic (but not referred) aliases |
2231 # warn about problematic (but not referred) aliases |
2232 for name, alias in sorted(aliases.iteritems()): |
2232 for name, alias in sorted(aliases.iteritems()): |
2233 if alias.error and not alias.warned: |
2233 if alias.error and not alias.warned: |
2234 msg = _('failed to parse revset alias "%s": %s' |
2234 showwarning(_('warning: %s\n') % (alias.error)) |
2235 ) % (name, alias.error) |
|
2236 showwarning(_('warning: %s\n') % (msg)) |
|
2237 alias.warned = True |
2235 alias.warned = True |
2238 return tree |
2236 return tree |
2239 |
2237 |
2240 def foldconcat(tree): |
2238 def foldconcat(tree): |
2241 """Fold elements to be concatenated by `##` |
2239 """Fold elements to be concatenated by `##` |