Patchwork D8207: phabricator: pass ui instead of repo to `userphids()`

login
register
mail settings
Submitter phabricator
Date March 4, 2020, 1:17 p.m.
Message ID <5b26046624d043676531c7f7c005771b@localhost.localdomain>
Download mbox | patch
Permalink /patch/45448/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2020, 1:17 p.m.
Closed by commit rHGa271ef1de086: phabricator: pass ui instead of repo to `userphids()` (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8207?vs=20423&id=20443

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1040,11 +1040,11 @@ 
     return revision, diff
 
 
-def userphids(repo, names):
+def userphids(ui, names):
     """convert user names to PHIDs"""
     names = [name.lower() for name in names]
     query = {b'constraints': {b'usernames': names}}
-    result = callconduit(repo.ui, b'user.search', query)
+    result = callconduit(ui, b'user.search', query)
     # username not found is not an error of the API. So check if we have missed
     # some names here.
     data = result[b'data']
@@ -1127,10 +1127,13 @@ 
     blockers = opts.get(b'blocker', [])
     phids = []
     if reviewers:
-        phids.extend(userphids(repo, reviewers))
+        phids.extend(userphids(repo.ui, reviewers))
     if blockers:
         phids.extend(
-            map(lambda phid: b'blocking(%s)' % phid, userphids(repo, blockers))
+            map(
+                lambda phid: b'blocking(%s)' % phid,
+                userphids(repo.ui, blockers),
+            )
         )
     if phids:
         actions.append({b'type': b'reviewers.add', b'value': phids})