]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Only show output from multiple commands when required
authorMike Fleetwood <mike.fleetwood@googlemail.com>
Sun, 1 Sep 2013 12:15:14 +0000 (13:15 +0100)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 3 Sep 2013 18:22:01 +0000 (14:22 -0400)
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 <joe.bloggs@example.com> 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 <joe.bloggs@example.com> 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 <joe.bloggs@example.com> 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

rcs-fast-import

index b2f7a932e695bdb258f7565ce627b7615f70c7f9..6a0eebab43856a5b5874635f3a95fa3210aaf01d 100755 (executable)
@@ -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: