Patchwork D6512: phabricator: add --blocker argument to phabsend to specify blocking reviewers

login
register
mail settings
Submitter phabricator
Date June 12, 2019, 4:44 p.m.
Message ID <09a48ef0f8ab76dbcc080ba433d04272@localhost.localdomain>
Download mbox | patch
Permalink /patch/40445/
State Not Applicable
Headers show

Comments

phabricator - June 12, 2019, 4:44 p.m.
Closed by commit rHGf33d3ee110da: phabricator: add --blocker argument to phabsend to specify blocking reviewers (authored by Kwan).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6512?vs=15447&id=15454

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6512/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6512

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: Kwan, durin42, mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -515,6 +515,7 @@ 
          [(b'r', b'rev', [], _(b'revisions to send'), _(b'REV')),
           (b'', b'amend', True, _(b'update commit messages')),
           (b'', b'reviewer', [], _(b'specify reviewers')),
+          (b'', b'blocker', [], _(b'specify blocking reviewers')),
           (b'm', b'comment', b'',
            _(b'add a comment to Revisions with new/updated Diffs')),
           (b'', b'confirm', None, _(b'ask for confirmation before sending'))],
@@ -568,8 +569,15 @@ 
 
     actions = []
     reviewers = opts.get(b'reviewer', [])
+    blockers = opts.get(b'blocker', [])
+    phids = []
     if reviewers:
-        phids = userphids(repo, reviewers)
+        phids.extend(userphids(repo, reviewers))
+    if blockers:
+        phids.extend(map(
+            lambda phid: b'blocking(%s)' % phid, userphids(repo, blockers)
+        ))
+    if phids:
         actions.append({b'type': b'reviewers.add', b'value': phids})
 
     drevids = [] # [int]