comparison hgext/convert/gnuarch.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 c6061cadb400
children c31ce080eb75
comparison
equal deleted inserted replaced
37119:d4a2e0d5d042 37120:a8a902d7176e
15 15
16 from mercurial.i18n import _ 16 from mercurial.i18n import _
17 from mercurial import ( 17 from mercurial import (
18 encoding, 18 encoding,
19 error, 19 error,
20 util,
21 ) 20 )
22 from mercurial.utils import dateutil 21 from mercurial.utils import (
22 dateutil,
23 procutil,
24 )
23 from . import common 25 from . import common
24 26
25 class gnuarch_source(common.converter_source, common.commandline): 27 class gnuarch_source(common.converter_source, common.commandline):
26 28
27 class gnuarch_rev(object): 29 class gnuarch_rev(object):
44 raise common.NoRepo(_("%s does not look like a GNU Arch repository") 46 raise common.NoRepo(_("%s does not look like a GNU Arch repository")
45 % path) 47 % path)
46 48
47 # Could use checktool, but we want to check for baz or tla. 49 # Could use checktool, but we want to check for baz or tla.
48 self.execmd = None 50 self.execmd = None
49 if util.findexe('baz'): 51 if procutil.findexe('baz'):
50 self.execmd = 'baz' 52 self.execmd = 'baz'
51 else: 53 else:
52 if util.findexe('tla'): 54 if procutil.findexe('tla'):
53 self.execmd = 'tla' 55 self.execmd = 'tla'
54 else: 56 else:
55 raise error.Abort(_('cannot find a GNU Arch tool')) 57 raise error.Abort(_('cannot find a GNU Arch tool'))
56 58
57 common.commandline.__init__(self, ui, self.execmd) 59 common.commandline.__init__(self, ui, self.execmd)
193 return self.tags 195 return self.tags
194 196
195 def _execute(self, cmd, *args, **kwargs): 197 def _execute(self, cmd, *args, **kwargs):
196 cmdline = [self.execmd, cmd] 198 cmdline = [self.execmd, cmd]
197 cmdline += args 199 cmdline += args
198 cmdline = [util.shellquote(arg) for arg in cmdline] 200 cmdline = [procutil.shellquote(arg) for arg in cmdline]
199 cmdline += ['>', os.devnull, '2>', os.devnull] 201 cmdline += ['>', os.devnull, '2>', os.devnull]
200 cmdline = util.quotecommand(' '.join(cmdline)) 202 cmdline = procutil.quotecommand(' '.join(cmdline))
201 self.ui.debug(cmdline, '\n') 203 self.ui.debug(cmdline, '\n')
202 return os.system(cmdline) 204 return os.system(cmdline)
203 205
204 def _update(self, rev): 206 def _update(self, rev):
205 self.ui.debug('applying revision %s...\n' % rev) 207 self.ui.debug('applying revision %s...\n' % rev)