[merge] let tarball exports write to '-' as stdout

John Arbash Meinel john at arbash-meinel.com
Thu May 29 14:54:42 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
| Martin Pool wrote:
|> A semi-trivial user request.
|>
|> Normally we create a root directory in the tarball (which is good
|> practice) based on the name of the output file; we can't do that if we
|> don't know it.  At the moment this uses '-' which is kind of
|> consistent but also a bit weird.
|
| Possibly the branch nick would be a good substitute.  The nick would need to be
| filtered similiarly to "bzr send"'s default filename (IIRC), though, to avoid
| characters like "/".
|
| Or perhaps --root should just be mandatory with an output file of "-".
|
| -Andrew.
|
|
|

I would just make --root mandatory, or have it have no root. So all files are
exported at the top level.

Looking at the code, though:
+    if dest == '-':
+        # XXX: If no root is given, the output tarball will contain files
+        # named '-/foo'; perhaps this is the most reasonable thing.
+        ball = tarfile.open(None, 'w|' + compression, sys.stdout)
+    else:
+        if root is None:
+            root = export.get_root_name(dest)
+        ball = tarfile.open(dest, 'w:' + compression)


^- You aren't setting a root if dest == '-'

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg+taIACgkQJdeBCYSNAAPydgCg1waaZ/re7JFtjHuw2SDqoSnN
ZdUAoIxxaiaY7Bn/zraD8Jms45D6fGUl
=tsvh
-----END PGP SIGNATURE-----



More information about the bazaar mailing list