Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG7a991241f586: py3: use .startswith() instead of bytes[0]
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
keys = "rev" | keys = "rev" | ||||
if 'keys' in args: | if 'keys' in args: | ||||
# i18n: "sort" is a keyword | # i18n: "sort" is a keyword | ||||
keys = getstring(args['keys'], _("sort spec must be a string")) | keys = getstring(args['keys'], _("sort spec must be a string")) | ||||
keyflags = [] | keyflags = [] | ||||
for k in keys.split(): | for k in keys.split(): | ||||
fk = k | fk = k | ||||
reverse = (k[0] == '-') | reverse = (k.startswith('-')) | ||||
if reverse: | if reverse: | ||||
k = k[1:] | k = k[1:] | ||||
if k not in _sortkeyfuncs and k != 'topo': | if k not in _sortkeyfuncs and k != 'topo': | ||||
raise error.ParseError(_("unknown sort key %r") % fk) | raise error.ParseError(_("unknown sort key %r") % fk) | ||||
keyflags.append((k, reverse)) | keyflags.append((k, reverse)) | ||||
if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): | if len(keyflags) > 1 and any(k == 'topo' for k, reverse in keyflags): | ||||
# i18n: "topo" is a keyword | # i18n: "topo" is a keyword |