Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG2b21c7fbb3a1: py3: use % instead of .format() on a bytestring
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| """:phabreview: Object describing the review for this changeset. | """:phabreview: Object describing the review for this changeset. | ||||
| Has attributes `url` and `id`. | Has attributes `url` and `id`. | ||||
| """ | """ | ||||
| ctx = context.resource(mapping, b'ctx') | ctx = context.resource(mapping, b'ctx') | ||||
| m = _differentialrevisiondescre.search(ctx.description()) | m = _differentialrevisiondescre.search(ctx.description()) | ||||
| if m: | if m: | ||||
| return templateutil.hybriddict({ | return templateutil.hybriddict({ | ||||
| b'url': m.group(r'url'), | b'url': m.group(r'url'), | ||||
| b'id': b"D{}".format(m.group(r'id')), | b'id': b"D%s" % m.group(r'id'), | ||||
| }) | }) | ||||
| else: | else: | ||||
| tags = ctx.repo().nodetags(ctx.node()) | tags = ctx.repo().nodetags(ctx.node()) | ||||
| for t in tags: | for t in tags: | ||||
| if _differentialrevisiontagre.match(t): | if _differentialrevisiontagre.match(t): | ||||
| url = ctx.repo().ui.config(b'phabricator', b'url') | url = ctx.repo().ui.config(b'phabricator', b'url') | ||||
| if not url.endswith(b'/'): | if not url.endswith(b'/'): | ||||
| url += b'/' | url += b'/' | ||||
| url += t | url += t | ||||
| return templateutil.hybriddict({ | return templateutil.hybriddict({ | ||||
| b'url': url, | b'url': url, | ||||
| b'id': t, | b'id': t, | ||||
| }) | }) | ||||
| return None | return None | ||||