subrepo: silence git output when ui.quiet is set

This commit is contained in:
Eric Eisner 2010-12-09 16:52:14 -05:00
parent 4c966e44c6
commit 196def6fd2
2 changed files with 7 additions and 4 deletions

View File

@ -623,10 +623,14 @@ class gitsubrepo(abstractsubrepo):
are not supported and very probably fail.
"""
self._ui.debug('%s: git %s\n' % (self._relpath, ' '.join(commands)))
# print git's stderr, which is mostly progress and useful info
# unless ui.quiet is set, print git's stderr,
# which is mostly progress and useful info
errpipe = None
if self._ui.quiet:
errpipe = open(os.devnull, 'w')
p = subprocess.Popen(['git'] + commands, bufsize=-1, cwd=cwd, env=env,
close_fds=util.closefds,
stdout=subprocess.PIPE)
stdout=subprocess.PIPE, stderr=errpipe)
if stream:
return p.stdout, None

View File

@ -81,8 +81,7 @@ clone root
update to previous substate
$ hg update 1 2>/dev/null
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg update 1 -q
$ cat s/g
g
$ hg debugsub