##// END OF EJS Templates
py3: replace os.environ with encoding.environ (part 1 of 5)...
Pulkit Goyal -
r30634:ad15646d default
parent child Browse files
Show More
@@ -8,7 +8,6
8 8 from __future__ import absolute_import
9 9
10 10 import errno
11 import os
12 11
13 12 from .i18n import _
14 13 from .node import (
@@ -31,7 +30,7 def _getbkfile(repo):
31 30 may need to tweak this behavior further.
32 31 """
33 32 bkfile = None
34 if 'HG_PENDING' in os.environ:
33 if 'HG_PENDING' in encoding.environ:
35 34 try:
36 35 bkfile = repo.vfs('bookmarks.pending')
37 36 except IOError as inst:
@@ -67,7 +67,7 def _trypending(root, vfs, filename):
67 67
68 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 71 try:
72 72 return (vfs('%s.pending' % filename), True)
73 73 except IOError as inst:
@@ -499,8 +499,8 class localrepository(object):
499 499 @storecache('00changelog.i')
500 500 def changelog(self):
501 501 c = changelog.changelog(self.svfs)
502 if 'HG_PENDING' in os.environ:
503 p = os.environ['HG_PENDING']
502 if 'HG_PENDING' in encoding.environ:
503 p = encoding.environ['HG_PENDING']
504 504 if p.startswith(self.root):
505 505 c.readpending('00changelog.i.a')
506 506 return c
@@ -1299,7 +1299,7 class localrepository(object):
1299 1299 # the contents of parentenvvar are used by the underlying lock to
1300 1300 # determine whether it can be inherited
1301 1301 if parentenvvar is not None:
1302 parentlock = os.environ.get(parentenvvar)
1302 parentlock = encoding.environ.get(parentenvvar)
1303 1303 try:
1304 1304 l = lockmod.lock(vfs, lockname, 0, releasefn=releasefn,
1305 1305 acquirefn=acquirefn, desc=desc,
@@ -103,7 +103,6 Note: old client behave as a publishing
103 103 from __future__ import absolute_import
104 104
105 105 import errno
106 import os
107 106
108 107 from .i18n import _
109 108 from .node import (
@@ -114,6 +113,7 from .node import (
114 113 short,
115 114 )
116 115 from . import (
116 encoding,
117 117 error,
118 118 )
119 119
@@ -137,7 +137,7 def _readroots(repo, phasedefaults=None)
137 137 roots = [set() for i in allphases]
138 138 try:
139 139 f = None
140 if 'HG_PENDING' in os.environ:
140 if 'HG_PENDING' in encoding.environ:
141 141 try:
142 142 f = repo.svfs('phaseroots.pending')
143 143 except IOError as inst:
@@ -462,7 +462,7 def findexe(command):
462 462 if sys.platform == 'plan9':
463 463 return findexisting(os.path.join('/bin', command))
464 464
465 for path in os.environ.get('PATH', '').split(pycompat.ospathsep):
465 for path in encoding.environ.get('PATH', '').split(pycompat.ospathsep):
466 466 executable = findexisting(os.path.join(path, command))
467 467 if executable is not None:
468 468 return executable
General Comments 0
You need to be logged in to leave comments. Login now