Skip to content

Commit

Permalink
make hg use non interactive (dirk-thomas#70)
Browse files Browse the repository at this point in the history
* make hg use noninteractive

* wrap after open bracket
  • Loading branch information
asibryant authored and dirk-thomas committed May 11, 2018
1 parent 4c25ae6 commit 1eaa691
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions vcstool/clients/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,18 @@ def import_(self, command):

if HgClient.is_repository(self.path):
# pull updates for existing repo
cmd_pull = [HgClient._executable, 'pull', '--update']
cmd_pull = [
HgClient._executable, '--noninteractive', 'pull', '--update']
result_pull = self._run_command(cmd_pull, retry=command.retry)
if result_pull['returncode']:
return result_pull
cmd = result_pull['cmd']
output = result_pull['output']

else:
cmd_clone = [HgClient._executable, 'clone', command.url, '.']
cmd_clone = [
HgClient._executable, '--noninteractive', 'clone', command.url,
'.']
result_clone = self._run_command(cmd_clone, retry=command.retry)
if result_clone['returncode']:
result_clone['output'] = \
Expand All @@ -156,7 +159,9 @@ def import_(self, command):
output = result_clone['output']

if command.version:
cmd_checkout = [HgClient._executable, 'checkout', command.version]
cmd_checkout = [
HgClient._executable, '--noninteractive', 'checkout',
command.version]
result_checkout = self._run_command(cmd_checkout)
if result_checkout['returncode']:
result_checkout['output'] = \
Expand Down Expand Up @@ -215,13 +220,13 @@ def log(self, command):

def pull(self, _command):
self._check_executable()
cmd = [HgClient._executable, 'pull', '--update']
cmd = [HgClient._executable, '--noninteractive', 'pull', '--update']
self._check_color(cmd)
return self._run_command(cmd)

def push(self, _command):
self._check_executable()
cmd = [HgClient._executable, 'push']
cmd = [HgClient._executable, '--noninteractive', 'push']
return self._run_command(cmd)

def remotes(self, _command):
Expand Down

0 comments on commit 1eaa691

Please sign in to comment.