diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-06 16:00:45 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-06 16:00:45 +0000 |
commit | 15aaa49bb85012c1d274993ce3808686810ce929 (patch) | |
tree | b40e8bfa07ce0b88f790241d664de2695aba1de5 /morphlib/git.py | |
parent | 09f4260d78c2be43e4174b9efa381de0ce05b9b1 (diff) | |
download | morph-15aaa49bb85012c1d274993ce3808686810ce929.tar.gz |
have git export directly to a tar file
Later, add compression by piping to a gzip process.
Diffstat (limited to 'morphlib/git.py')
-rw-r--r-- | morphlib/git.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/morphlib/git.py b/morphlib/git.py index 14cba0e6..59f59c9b 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -14,7 +14,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import gzip import logging import urlparse @@ -40,11 +39,7 @@ class TooManyMorphs(Exception): def export_sources(repo, ref, tar_filename): '''Export the contents of a specific commit into a compressed tarball.''' ex = morphlib.execute.Execute('.', msg=logging.debug) - tar = ex.runv(['git', 'archive', '--remote', repo, ref]) - f = gzip.open(tar_filename, 'wb') - f.write(tar) - f.close() - + ex.runv(['git', 'archive', '-o', tar_filename, '--remote', repo, ref]) def get_commit_id(repo, ref): '''Return the full SHA-1 commit id for a repo+ref.''' |