comparison hgext/acl.py @ 38783:e7aa113b14f7

global: use pycompat.xrange() On Python 3, our module importer automatically rewrites xrange() to pycompat.xrange(). We want to move away from the custom importer on Python 3. This commit converts all instances of xrange() to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4032
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Aug 2018 13:00:45 -0700
parents 6beb8347b709
children 3694c9aaf5e4
comparison
equal deleted inserted replaced
38782:7eba8f83129b 38783:e7aa113b14f7
218 from mercurial.i18n import _ 218 from mercurial.i18n import _
219 from mercurial import ( 219 from mercurial import (
220 error, 220 error,
221 extensions, 221 extensions,
222 match, 222 match,
223 pycompat,
223 registrar, 224 registrar,
224 util, 225 util,
225 ) 226 )
226 from mercurial.utils import ( 227 from mercurial.utils import (
227 procutil, 228 procutil,
401 allowbranches = buildmatch(ui, None, user, 'acl.allow.branches') 402 allowbranches = buildmatch(ui, None, user, 'acl.allow.branches')
402 denybranches = buildmatch(ui, None, user, 'acl.deny.branches') 403 denybranches = buildmatch(ui, None, user, 'acl.deny.branches')
403 allow = buildmatch(ui, repo, user, 'acl.allow') 404 allow = buildmatch(ui, repo, user, 'acl.allow')
404 deny = buildmatch(ui, repo, user, 'acl.deny') 405 deny = buildmatch(ui, repo, user, 'acl.deny')
405 406
406 for rev in xrange(repo[node].rev(), len(repo)): 407 for rev in pycompat.xrange(repo[node].rev(), len(repo)):
407 ctx = repo[rev] 408 ctx = repo[rev]
408 branch = ctx.branch() 409 branch = ctx.branch()
409 if denybranches and denybranches(branch): 410 if denybranches and denybranches(branch):
410 raise error.Abort(_('acl: user "%s" denied on branch "%s"' 411 raise error.Abort(_('acl: user "%s" denied on branch "%s"'
411 ' (changeset "%s")') 412 ' (changeset "%s")')