Mercurial > public > mercurial-scm > hg
comparison mercurial/parser.py @ 43117:8ff1ecfadcd1
cleanup: join string literals that are already on one line
Thanks to Kyle for noticing this and for providing the regular
expression to run on the codebase.
This patch has been reviewed by the test suite and they approved of
it.
# skip-blame: fallout from mass reformatting
Differential Revision: https://phab.mercurial-scm.org/D7028
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 08 Oct 2019 15:06:18 -0700 |
parents | 687b865b95ad |
children | be8552f25cab |
comparison
equal
deleted
inserted
replaced
43116:defabf63e969 | 43117:8ff1ecfadcd1 |
---|---|
161 (i for i, x in enumerate(trees) if x and x[0] == keyvaluenode), | 161 (i for i, x in enumerate(trees) if x and x[0] == keyvaluenode), |
162 len(trees), | 162 len(trees), |
163 ) | 163 ) |
164 if kwstart < len(poskeys): | 164 if kwstart < len(poskeys): |
165 raise error.ParseError( | 165 raise error.ParseError( |
166 _(b"%(func)s takes at least %(nargs)d positional " b"arguments") | 166 _(b"%(func)s takes at least %(nargs)d positional arguments") |
167 % {b'func': funcname, b'nargs': len(poskeys)} | 167 % {b'func': funcname, b'nargs': len(poskeys)} |
168 ) | 168 ) |
169 if not varkey and kwstart > len(poskeys) + len(keys): | 169 if not varkey and kwstart > len(poskeys) + len(keys): |
170 raise error.ParseError( | 170 raise error.ParseError( |
171 _(b"%(func)s takes at most %(nargs)d positional " b"arguments") | 171 _(b"%(func)s takes at most %(nargs)d positional arguments") |
172 % {b'func': funcname, b'nargs': len(poskeys) + len(keys)} | 172 % {b'func': funcname, b'nargs': len(poskeys) + len(keys)} |
173 ) | 173 ) |
174 args = util.sortdict() | 174 args = util.sortdict() |
175 # consume positional arguments | 175 # consume positional arguments |
176 for k, x in zip(poskeys, trees[:kwstart]): | 176 for k, x in zip(poskeys, trees[:kwstart]): |
191 k = x[1][1] | 191 k = x[1][1] |
192 if k in keys: | 192 if k in keys: |
193 d = args | 193 d = args |
194 elif not optkey: | 194 elif not optkey: |
195 raise error.ParseError( | 195 raise error.ParseError( |
196 _(b"%(func)s got an unexpected keyword " b"argument '%(key)s'") | 196 _(b"%(func)s got an unexpected keyword argument '%(key)s'") |
197 % {b'func': funcname, b'key': k} | 197 % {b'func': funcname, b'key': k} |
198 ) | 198 ) |
199 else: | 199 else: |
200 d = args[optkey] | 200 d = args[optkey] |
201 if k in d: | 201 if k in d: |
711 a, l = r | 711 a, l = r |
712 if a.error: | 712 if a.error: |
713 raise error.Abort(a.error) | 713 raise error.Abort(a.error) |
714 if a in expanding: | 714 if a in expanding: |
715 raise error.ParseError( | 715 raise error.ParseError( |
716 _(b'infinite expansion of %(section)s ' b'"%(name)s" detected') | 716 _(b'infinite expansion of %(section)s "%(name)s" detected') |
717 % {b'section': cls._section, b'name': a.name} | 717 % {b'section': cls._section, b'name': a.name} |
718 ) | 718 ) |
719 # get cacheable replacement tree by expanding aliases recursively | 719 # get cacheable replacement tree by expanding aliases recursively |
720 expanding.append(a) | 720 expanding.append(a) |
721 if a.name not in cache: | 721 if a.name not in cache: |