From: Mike Fleetwood Date: Sun, 1 Sep 2013 12:15:14 +0000 (+0100) Subject: Only show output from multiple commands when required X-Git-Tag: 0.2~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=a09a9ea0692e1da6bf123eeb5943a651276ebba8;p=rcs-fast-import.git Only show output from multiple commands when required After the previous commit: Fix importing of branches into RCS a command may be made up of multiple commands. Ensure that output from all commands is only shown when verbose level warrants it. Test case: $ cat test-04-branches.fastexp commit refs/heads/master mark :1 committer Joe Bloggs 999091736 +0100 data 13 Add file.txt M 644 inline file.txt data 51 Contents of file.txt, changeset 1/3, branch master commit refs/heads/b1 mark :2 committer Joe Bloggs 999098479 +0100 data 29 Update file.txt on branch b1 from :1 M 644 inline file.txt data 47 Contents of file.txt, changeset 2/3, branch b1 commit refs/heads/master mark :3 committer Joe Bloggs 999098479 +0100 data 33 Update file.txt on branch master from :1 M 644 inline file.txt data 51 Contents of file.txt, changeset 3/3, branch master $ rcs-fast-import < test-04-branches.fastexp RCS file: RCS/file.txt,v 1.1.1.1 unlocked done RCS file: RCS/file.txt,v 1.1 locked done --- diff --git a/rcs-fast-import b/rcs-fast-import index b2f7a93..6a0eeba 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -553,7 +553,7 @@ def do_or_die(cmd, legend=""): if verbose >= DEBUG_COMMANDS: announce("executing '%s'%s" % (cmd, legend)) if not verbose >= DEBUG_UNQUIET: - cmd += ">/dev/null 2>&1" + cmd = "(" + cmd + ") >/dev/null 2>&1" try: retcode = subprocess.call(cmd, shell=True) if retcode < 0: