Mercurial > hg
comparison hgext/narrow/narrowbundle2.py @ 36162:4224f26c0d35
narrow: fix for getting the username when running http server
Differential Revision: https://phab.mercurial-scm.org/D2231
author | Sandu Turcan <idlsoft@gmail.com> |
---|---|
date | Tue, 13 Feb 2018 14:39:02 -0500 |
parents | 9fd8c2a3db5a |
children | c407ccd06abd |
comparison
equal
deleted
inserted
replaced
36161:48797b21882e | 36162:4224f26c0d35 |
---|---|
325 part.addparam('version', version) | 325 part.addparam('version', version) |
326 if 'treemanifest' in repo.requirements: | 326 if 'treemanifest' in repo.requirements: |
327 part.addparam('treemanifest', '1') | 327 part.addparam('treemanifest', '1') |
328 | 328 |
329 def applyacl_narrow(repo, kwargs): | 329 def applyacl_narrow(repo, kwargs): |
330 username = repo.ui.shortuser(repo.ui.username()) | 330 ui = repo.ui |
331 user_includes = repo.ui.configlist( | 331 username = ui.shortuser(ui.environ.get('REMOTE_USER') or ui.username()) |
332 user_includes = ui.configlist( | |
332 _NARROWACL_SECTION, username + '.includes', | 333 _NARROWACL_SECTION, username + '.includes', |
333 repo.ui.configlist(_NARROWACL_SECTION, 'default.includes')) | 334 ui.configlist(_NARROWACL_SECTION, 'default.includes')) |
334 user_excludes = repo.ui.configlist( | 335 user_excludes = ui.configlist( |
335 _NARROWACL_SECTION, username + '.excludes', | 336 _NARROWACL_SECTION, username + '.excludes', |
336 repo.ui.configlist(_NARROWACL_SECTION, 'default.excludes')) | 337 ui.configlist(_NARROWACL_SECTION, 'default.excludes')) |
337 if not user_includes: | 338 if not user_includes: |
338 raise error.Abort(_("{} configuration for user {} is empty") | 339 raise error.Abort(_("{} configuration for user {} is empty") |
339 .format(_NARROWACL_SECTION, username)) | 340 .format(_NARROWACL_SECTION, username)) |
340 | 341 |
341 user_includes = [ | 342 user_includes = [ |