comparison mercurial/scmutil.py @ 49972:1bd33932713d

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jan 2023 11:41:59 +0100
parents 4bd12c0f531e 566f7dd563c1
children 28dfb2df4ab9
comparison
equal deleted inserted replaced
49967:5698c5eee12b 49972:1bd33932713d
276 raise error.InputError( 276 raise error.InputError(
277 _(b"%r cannot be used in a name") % pycompat.bytestr(c) 277 _(b"%r cannot be used in a name") % pycompat.bytestr(c)
278 ) 278 )
279 try: 279 try:
280 int(lbl) 280 int(lbl)
281 if b'_' in lbl:
282 # If label contains underscores, Python might consider it an
283 # integer (with "_" as visual separators), but we do not.
284 # See PEP 515 - Underscores in Numeric Literals.
285 raise ValueError
281 raise error.InputError(_(b"cannot use an integer as a name")) 286 raise error.InputError(_(b"cannot use an integer as a name"))
282 except ValueError: 287 except ValueError:
283 pass 288 pass
284 if lbl.strip() != lbl: 289 if lbl.strip() != lbl:
285 raise error.InputError( 290 raise error.InputError(