Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGbb5f5c1c3c1b: scmutil: fix a repr in an error message on Python 3
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/scmutil.py (3 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Abandoned | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Closed | durin42 | ||
Abandoned | durin42 |
def checknewlabel(repo, lbl, kind): | def checknewlabel(repo, lbl, kind): | ||||
# Do not use the "kind" parameter in ui output. | # Do not use the "kind" parameter in ui output. | ||||
# It makes strings difficult to translate. | # It makes strings difficult to translate. | ||||
if lbl in ['tip', '.', 'null']: | if lbl in ['tip', '.', 'null']: | ||||
raise error.Abort(_("the name '%s' is reserved") % lbl) | raise error.Abort(_("the name '%s' is reserved") % lbl) | ||||
for c in (':', '\0', '\n', '\r'): | for c in (':', '\0', '\n', '\r'): | ||||
if c in lbl: | if c in lbl: | ||||
raise error.Abort(_("%r cannot be used in a name") % c) | raise error.Abort( | ||||
_("%r cannot be used in a name") % pycompat.bytestr(c)) | |||||
try: | try: | ||||
int(lbl) | int(lbl) | ||||
raise error.Abort(_("cannot use an integer as a name")) | raise error.Abort(_("cannot use an integer as a name")) | ||||
except ValueError: | except ValueError: | ||||
pass | pass | ||||
if lbl.strip() != lbl: | if lbl.strip() != lbl: | ||||
raise error.Abort(_("leading or trailing whitespace in name %r") % lbl) | raise error.Abort(_("leading or trailing whitespace in name %r") % lbl) | ||||