This is a helpful way to have it open and write to the given output file.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
bup join [-r host:path] [refs or hashes...]
--
r,remote= remote repository path
+o= output filename
"""
o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
cp = git.CatPipe()
cat = cp.join
+if opt.o:
+ outfile = open(opt.o, 'wb')
+else:
+ outfile = sys.stdout
+
for id in extra:
try:
for blob in cat(id):
- sys.stdout.write(blob)
+ outfile.write(blob)
except KeyError, e:
- sys.stdout.flush()
+ outfile.flush()
log('error: %s\n' % e)
ret = 1
WVSTART "join"
WVPASS bup join $(cat tags1.tmp) >out1.tmp
WVPASS bup join <tags2.tmp >out2.tmp
-WVPASS bup join <tags2t.tmp >out2t.tmp
+WVPASS bup join <tags2t.tmp -o out2t.tmp
WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
WVPASS diff -u t/testfile1 out1.tmp