comparison mercurial/subrepo.py @ 37120:a8a902d7176e

procutil: bulk-replace function calls to point to new module
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 15:10:51 +0900
parents f0b6fbea00cf
children 335e19c6b7fa
comparison
equal deleted inserted replaced
37119:d4a2e0d5d042 37120:a8a902d7176e
36 util, 36 util,
37 vfs as vfsmod, 37 vfs as vfsmod,
38 ) 38 )
39 from .utils import ( 39 from .utils import (
40 dateutil, 40 dateutil,
41 procutil,
41 stringutil, 42 stringutil,
42 ) 43 )
43 44
44 hg = None 45 hg = None
45 reporelpath = subrepoutil.reporelpath 46 reporelpath = subrepoutil.reporelpath
910 911
911 class svnsubrepo(abstractsubrepo): 912 class svnsubrepo(abstractsubrepo):
912 def __init__(self, ctx, path, state, allowcreate): 913 def __init__(self, ctx, path, state, allowcreate):
913 super(svnsubrepo, self).__init__(ctx, path) 914 super(svnsubrepo, self).__init__(ctx, path)
914 self._state = state 915 self._state = state
915 self._exe = util.findexe('svn') 916 self._exe = procutil.findexe('svn')
916 if not self._exe: 917 if not self._exe:
917 raise error.Abort(_("'svn' executable not found for subrepo '%s'") 918 raise error.Abort(_("'svn' executable not found for subrepo '%s'")
918 % self._path) 919 % self._path)
919 920
920 def _svncommand(self, commands, filename='', failok=False): 921 def _svncommand(self, commands, filename='', failok=False):
940 lc_all = env.get('LC_ALL') 941 lc_all = env.get('LC_ALL')
941 if lc_all: 942 if lc_all:
942 env['LANG'] = lc_all 943 env['LANG'] = lc_all
943 del env['LC_ALL'] 944 del env['LC_ALL']
944 env['LC_MESSAGES'] = 'C' 945 env['LC_MESSAGES'] = 'C'
945 p = subprocess.Popen(cmd, bufsize=-1, close_fds=util.closefds, 946 p = subprocess.Popen(cmd, bufsize=-1, close_fds=procutil.closefds,
946 stdout=subprocess.PIPE, stderr=subprocess.PIPE, 947 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
947 universal_newlines=True, env=env, **extrakw) 948 universal_newlines=True, env=env, **extrakw)
948 stdout, stderr = p.communicate() 949 stdout, stderr = p.communicate()
949 stderr = stderr.strip() 950 stderr = stderr.strip()
950 if not failok: 951 if not failok:
1258 if self.ui._colormode and len(commands) and commands[0] == "diff": 1259 if self.ui._colormode and len(commands) and commands[0] == "diff":
1259 # insert the argument in the front, 1260 # insert the argument in the front,
1260 # the end of git diff arguments is used for paths 1261 # the end of git diff arguments is used for paths
1261 commands.insert(1, '--color') 1262 commands.insert(1, '--color')
1262 p = subprocess.Popen([self._gitexecutable] + commands, bufsize=-1, 1263 p = subprocess.Popen([self._gitexecutable] + commands, bufsize=-1,
1263 cwd=cwd, env=env, close_fds=util.closefds, 1264 cwd=cwd, env=env, close_fds=procutil.closefds,
1264 stdout=subprocess.PIPE, stderr=errpipe) 1265 stdout=subprocess.PIPE, stderr=errpipe)
1265 if stream: 1266 if stream:
1266 return p.stdout, None 1267 return p.stdout, None
1267 1268
1268 retdata = p.stdout.read().strip() 1269 retdata = p.stdout.read().strip()