diff options
author | John L. Villalovos <john.l.villalovos@intel.com> | 2015-03-16 20:49:10 -0700 |
---|---|---|
committer | John L. Villalovos <john.l.villalovos@intel.com> | 2015-03-26 11:43:55 -0700 |
commit | 9c76f67f13c033b67b23206798701548207dd880 (patch) | |
tree | e089031b26a7fb97ee099bb6f7bdb21deaebafc0 /project.py | |
parent | 52b99aa91d0fbb5ea363b5febb367d602dbc56db (diff) | |
download | git-repo-9c76f67f13c033b67b23206798701548207dd880.tar.gz |
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
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1874,10 +1874,8 @@ class Project(object): | |||
1874 | 1874 | ||
1875 | ok = False | 1875 | ok = False |
1876 | for _i in range(2): | 1876 | for _i in range(2): |
1877 | gitcmd = GitCommand(self, cmd, bare=True, capture_stderr=True, | 1877 | gitcmd = GitCommand(self, cmd, bare=True, ssh_proxy=ssh_proxy) |
1878 | ssh_proxy=ssh_proxy) | ||
1879 | ret = gitcmd.Wait() | 1878 | ret = gitcmd.Wait() |
1880 | print(gitcmd.stderr, file=sys.stderr, end='') | ||
1881 | if ret == 0: | 1879 | if ret == 0: |
1882 | ok = True | 1880 | ok = True |
1883 | break | 1881 | break |
@@ -1886,9 +1884,8 @@ class Project(object): | |||
1886 | "error:" in gitcmd.stderr and | 1884 | "error:" in gitcmd.stderr and |
1887 | "git remote prune" in gitcmd.stderr): | 1885 | "git remote prune" in gitcmd.stderr): |
1888 | prunecmd = GitCommand(self, ['remote', 'prune', name], bare=True, | 1886 | prunecmd = GitCommand(self, ['remote', 'prune', name], bare=True, |
1889 | capture_stderr=True, ssh_proxy=ssh_proxy) | 1887 | ssh_proxy=ssh_proxy) |
1890 | ret = prunecmd.Wait() | 1888 | ret = prunecmd.Wait() |
1891 | print(prunecmd.stderr, file=sys.stderr, end='') | ||
1892 | if ret: | 1889 | if ret: |
1893 | break | 1890 | break |
1894 | continue | 1891 | continue |