This is similar to 16312ea45a8b- we don't need a repo, but will load .hg/hgrc if
inside one.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/phabricator.py (3 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 74da73732c54 | e307f8f55759 | Matt Harbison | Feb 17 2020, 1:14 PM |
| Status | Author | Revision | |
|---|---|---|---|
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 | ||
| Closed | mharbison72 |
| (b'', b'accept', False, _(b'accept revisions')), | (b'', b'accept', False, _(b'accept revisions')), | ||||
| (b'', b'reject', False, _(b'reject revisions')), | (b'', b'reject', False, _(b'reject revisions')), | ||||
| (b'', b'abandon', False, _(b'abandon revisions')), | (b'', b'abandon', False, _(b'abandon revisions')), | ||||
| (b'', b'reclaim', False, _(b'reclaim revisions')), | (b'', b'reclaim', False, _(b'reclaim revisions')), | ||||
| (b'm', b'comment', b'', _(b'comment on the last revision')), | (b'm', b'comment', b'', _(b'comment on the last revision')), | ||||
| ], | ], | ||||
| _(b'DREVSPEC [OPTIONS]'), | _(b'DREVSPEC [OPTIONS]'), | ||||
| helpcategory=command.CATEGORY_IMPORT_EXPORT, | helpcategory=command.CATEGORY_IMPORT_EXPORT, | ||||
| optionalrepo=True, | |||||
| ) | ) | ||||
| def phabupdate(ui, repo, spec, **opts): | def phabupdate(ui, repo, spec, **opts): | ||||
| """update Differential Revision in batch | """update Differential Revision in batch | ||||
| DREVSPEC selects revisions. See :hg:`help phabread` for its usage. | DREVSPEC selects revisions. See :hg:`help phabread` for its usage. | ||||
| """ | """ | ||||
| opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
| flags = [n for n in b'accept reject abandon reclaim'.split() if opts.get(n)] | flags = [n for n in b'accept reject abandon reclaim'.split() if opts.get(n)] | ||||
| if len(flags) > 1: | if len(flags) > 1: | ||||
| raise error.Abort(_(b'%s cannot be used together') % b', '.join(flags)) | raise error.Abort(_(b'%s cannot be used together') % b', '.join(flags)) | ||||
| actions = [] | actions = [] | ||||
| for f in flags: | for f in flags: | ||||
| actions.append({b'type': f, b'value': True}) | actions.append({b'type': f, b'value': True}) | ||||
| drevs = querydrev(repo.ui, spec) | drevs = querydrev(ui, spec) | ||||
| for i, drev in enumerate(drevs): | for i, drev in enumerate(drevs): | ||||
| if i + 1 == len(drevs) and opts.get(b'comment'): | if i + 1 == len(drevs) and opts.get(b'comment'): | ||||
| actions.append({b'type': b'comment', b'value': opts[b'comment']}) | actions.append({b'type': b'comment', b'value': opts[b'comment']}) | ||||
| if actions: | if actions: | ||||
| params = { | params = { | ||||
| b'objectIdentifier': drev[b'phid'], | b'objectIdentifier': drev[b'phid'], | ||||
| b'transactions': actions, | b'transactions': actions, | ||||
| } | } | ||||