From patchwork Fri Feb 15 21:02:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D5934: phabricator: make user searches case-insensitive From: phabricator X-Patchwork-Id: 38773 Message-Id: <2074e02c6e907a287a2f8588cfd0af25@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 15 Feb 2019 21:02:10 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG570e62f1dcf2: phabricator: make user searches case-insensitive (authored by jcristau, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5934?vs=14030&id=14110 REVISION DETAIL https://phab.mercurial-scm.org/D5934 AFFECTED FILES hgext/phabricator.py CHANGE DETAILS To: jcristau, #hg-reviewers Cc: mercurial-devel diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -450,12 +450,13 @@ def userphids(repo, names): """convert user names to PHIDs""" + names = [name.lower() for name in names] query = {b'constraints': {b'usernames': names}} result = callconduit(repo, 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[r'data'] - resolved = set(entry[r'fields'][r'username'] for entry in data) + resolved = set(entry[r'fields'][r'username'].lower() for entry in data) unresolved = set(names) - resolved if unresolved: raise error.Abort(_(b'unknown username: %s')