comparison mercurial/server.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 aac4be30e250
children 368ecbf734af
comparison
equal deleted inserted replaced
38782:7eba8f83129b 38783:e7aa113b14f7
77 if not runargs: 77 if not runargs:
78 runargs = procutil.hgcmd() + pycompat.sysargv[1:] 78 runargs = procutil.hgcmd() + pycompat.sysargv[1:]
79 runargs.append('--daemon-postexec=unlink:%s' % lockpath) 79 runargs.append('--daemon-postexec=unlink:%s' % lockpath)
80 # Don't pass --cwd to the child process, because we've already 80 # Don't pass --cwd to the child process, because we've already
81 # changed directory. 81 # changed directory.
82 for i in xrange(1, len(runargs)): 82 for i in pycompat.xrange(1, len(runargs)):
83 if runargs[i].startswith('--cwd='): 83 if runargs[i].startswith('--cwd='):
84 del runargs[i] 84 del runargs[i]
85 break 85 break
86 elif runargs[i].startswith('--cwd'): 86 elif runargs[i].startswith('--cwd'):
87 del runargs[i:i + 2] 87 del runargs[i:i + 2]