comparison mercurial/localrepo.py @ 30639:ad15646dc61c

py3: replace os.environ with encoding.environ (part 1 of 5) os.environ is a dictionary which has string elements on Python 3. We have encoding.environ which take care of all these things. This is the first patch of 5 patch series which tend to replace the occurences of os.environ with encoding.environ as using os.environ will result in unusual behaviour.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 18 Dec 2016 01:34:41 +0530
parents f8c9a7d2bbbf
children 4c0a5a256ae8
comparison
equal deleted inserted replaced
30638:fd244e047ec0 30639:ad15646dc61c
497 return store 497 return store
498 498
499 @storecache('00changelog.i') 499 @storecache('00changelog.i')
500 def changelog(self): 500 def changelog(self):
501 c = changelog.changelog(self.svfs) 501 c = changelog.changelog(self.svfs)
502 if 'HG_PENDING' in os.environ: 502 if 'HG_PENDING' in encoding.environ:
503 p = os.environ['HG_PENDING'] 503 p = encoding.environ['HG_PENDING']
504 if p.startswith(self.root): 504 if p.startswith(self.root):
505 c.readpending('00changelog.i.a') 505 c.readpending('00changelog.i.a')
506 return c 506 return c
507 507
508 def _constructmanifest(self): 508 def _constructmanifest(self):
1297 inheritchecker=None, parentenvvar=None): 1297 inheritchecker=None, parentenvvar=None):
1298 parentlock = None 1298 parentlock = None
1299 # the contents of parentenvvar are used by the underlying lock to 1299 # the contents of parentenvvar are used by the underlying lock to
1300 # determine whether it can be inherited 1300 # determine whether it can be inherited
1301 if parentenvvar is not None: 1301 if parentenvvar is not None:
1302 parentlock = os.environ.get(parentenvvar) 1302 parentlock = encoding.environ.get(parentenvvar)
1303 try: 1303 try:
1304 l = lockmod.lock(vfs, lockname, 0, releasefn=releasefn, 1304 l = lockmod.lock(vfs, lockname, 0, releasefn=releasefn,
1305 acquirefn=acquirefn, desc=desc, 1305 acquirefn=acquirefn, desc=desc,
1306 inheritchecker=inheritchecker, 1306 inheritchecker=inheritchecker,
1307 parentlock=parentlock) 1307 parentlock=parentlock)