comparison hgext/phabricator.py @ 46907:ffd3e823a7e5

urlutil: extract `url` related code from `util` into the new module The new module is well fitting for this new code. And this will be useful to make the gathered code collaborate more later. Differential Revision: https://phab.mercurial-scm.org/D10374
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 12 Apr 2021 03:01:04 +0200
parents 9624bf057c2a
children d55b71393907 067f2c53fb24
comparison
equal deleted inserted replaced
46906:33524c46a092 46907:ffd3e823a7e5
101 util, 101 util,
102 ) 102 )
103 from mercurial.utils import ( 103 from mercurial.utils import (
104 procutil, 104 procutil,
105 stringutil, 105 stringutil,
106 urlutil,
106 ) 107 )
107 from . import show 108 from . import show
108 109
109 110
110 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 111 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
364 process(b'%s[%s]' % (prefix, k), v) 365 process(b'%s[%s]' % (prefix, k), v)
365 else: 366 else:
366 process(k, v) 367 process(k, v)
367 368
368 process(b'', params) 369 process(b'', params)
369 return util.urlreq.urlencode(flatparams) 370 return urlutil.urlreq.urlencode(flatparams)
370 371
371 372
372 def readurltoken(ui): 373 def readurltoken(ui):
373 """return conduit url, token and make sure they exist 374 """return conduit url, token and make sure they exist
374 375
379 if not url: 380 if not url:
380 raise error.Abort( 381 raise error.Abort(
381 _(b'config %s.%s is required') % (b'phabricator', b'url') 382 _(b'config %s.%s is required') % (b'phabricator', b'url')
382 ) 383 )
383 384
384 res = httpconnectionmod.readauthforuri(ui, url, util.url(url).user) 385 res = httpconnectionmod.readauthforuri(ui, url, urlutil.url(url).user)
385 token = None 386 token = None
386 387
387 if res: 388 if res:
388 group, auth = res 389 group, auth = res
389 390