Mercurial > hg
changeset 44420:ddcb51390891
phabricator: pass ui instead of repo to `userphids()`
Also not a repository operation.
Differential Revision: https://phab.mercurial-scm.org/D8207
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 17 Feb 2020 13:28:40 -0500 |
parents | df8053082364 |
children | b715432fabba |
files | hgext/phabricator.py |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/phabricator.py Mon Feb 17 13:08:01 2020 -0500 +++ b/hgext/phabricator.py Mon Feb 17 13:28:40 2020 -0500 @@ -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})