comparison mercurial/dirstate.py @ 30634: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 cfe66dcf45c0
children 206532700213
comparison
equal deleted inserted replaced
30633:fd244e047ec0 30634:ad15646dc61c
65 This opens '.pending' of specified 'filename' only when HG_PENDING 65 This opens '.pending' of specified 'filename' only when HG_PENDING
66 is equal to 'root'. 66 is equal to 'root'.
67 67
68 This returns '(fp, is_pending_opened)' tuple. 68 This returns '(fp, is_pending_opened)' tuple.
69 ''' 69 '''
70 if root == os.environ.get('HG_PENDING'): 70 if root == encoding.environ.get('HG_PENDING'):
71 try: 71 try:
72 return (vfs('%s.pending' % filename), True) 72 return (vfs('%s.pending' % filename), True)
73 except IOError as inst: 73 except IOError as inst:
74 if inst.errno != errno.ENOENT: 74 if inst.errno != errno.ENOENT:
75 raise 75 raise