1
0
Fork 0

Always capture output for GitCommand

Switch the GitCommand program to always capture the output for stdout
and stderr.  And by default print the output while running.

The options capture_stdout and capture_stderr have effectively become
options to supress the printing of stdout and stderr.

Update the 'git fetch' to use '--progress' so that the progress messages
will be displayed.  git checks if the output location isatty() and if it
is not a TTY it will by default not print the progress messages.

Change-Id: Ifdae138e008f80a59195f9f43c911a1a5210ec60
This commit is contained in:
John L. Villalovos 2015-03-16 20:49:10 -07:00
parent 52b99aa91d
commit 9c76f67f13
2 changed files with 54 additions and 17 deletions

View file

@ -1874,10 +1874,8 @@ class Project(object):
ok = False
for _i in range(2):
gitcmd = GitCommand(self, cmd, bare=True, capture_stderr=True,
ssh_proxy=ssh_proxy)
gitcmd = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy)
ret = gitcmd.Wait()
print(gitcmd.stderr, file=sys.stderr, end='')
if ret == 0:
ok = True
break
@ -1886,9 +1884,8 @@ class Project(object):
"error:" in gitcmd.stderr and
"git remote prune" in gitcmd.stderr):
prunecmd = GitCommand(self, ['remote', 'prune', name], bare=True,
capture_stderr=True, ssh_proxy=ssh_proxy)
ssh_proxy=ssh_proxy)
ret = prunecmd.Wait()
print(prunecmd.stderr, file=sys.stderr, end='')
if ret:
break
continue