Mercurial > hg
comparison hgext/acl.py @ 36376:dbadf28d4db0
py3: use pycompat.bytestr to convert str returned by getpass.getuser to bytes
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 23 Feb 2018 17:14:25 +0530 |
parents | 120c5c155ba4 |
children | 39212037e65e |
comparison
equal
deleted
inserted
replaced
36375:f798709eb4b9 | 36376:dbadf28d4db0 |
---|---|
198 from mercurial.i18n import _ | 198 from mercurial.i18n import _ |
199 from mercurial import ( | 199 from mercurial import ( |
200 error, | 200 error, |
201 extensions, | 201 extensions, |
202 match, | 202 match, |
203 pycompat, | |
203 registrar, | 204 registrar, |
204 util, | 205 util, |
205 ) | 206 ) |
206 | 207 |
207 urlreq = util.urlreq | 208 urlreq = util.urlreq |
338 url = kwargs['url'].split(':') | 339 url = kwargs['url'].split(':') |
339 if url[0] == 'remote' and url[1].startswith('http'): | 340 if url[0] == 'remote' and url[1].startswith('http'): |
340 user = urlreq.unquote(url[3]) | 341 user = urlreq.unquote(url[3]) |
341 | 342 |
342 if user is None: | 343 if user is None: |
343 user = getpass.getuser() | 344 user = pycompat.bytestr(getpass.getuser()) |
344 | 345 |
345 ui.debug('acl: checking access for user "%s"\n' % user) | 346 ui.debug('acl: checking access for user "%s"\n' % user) |
346 | 347 |
347 # deprecated config: acl.config | 348 # deprecated config: acl.config |
348 cfg = ui.config('acl', 'config') | 349 cfg = ui.config('acl', 'config') |