~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/tar_exporter.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-08 02:23:17 UTC
  • mto: This revision was merged to the branch mainline in revision 5086.
  • Revision ID: jelmer@samba.org-20100308022317-hmxztr4jz5danig8
Review comments from Rob.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
 
34
34
def tar_exporter(tree, dest, root, subdir, compression=None, filtered=False,
35
 
                 use_tree_timestamp=False):
 
35
                 per_file_timestamps=False):
36
36
    """Export this tree to a new tar file.
37
37
 
38
38
    `dest` will be created holding the contents of this tree; if it
52
52
    for dp, ie in _export_iter_entries(tree, subdir):
53
53
        filename = osutils.pathjoin(root, dp).encode('utf8')
54
54
        item = tarfile.TarInfo(filename)
55
 
        if use_tree_timestamp:
 
55
        if per_file_timestamps:
56
56
            item.mtime = tree.get_file_mtime(ie.file_id, dp)
57
57
        else:
58
58
            item.mtime = now
93
93
 
94
94
 
95
95
def tgz_exporter(tree, dest, root, subdir, filtered=False,
96
 
                 use_tree_timestamp=False):
 
96
                 per_file_timestamps=False):
97
97
    tar_exporter(tree, dest, root, subdir, compression='gz',
98
 
                 filtered=filtered, use_tree_timestamp=use_tree_timestamp)
 
98
                 filtered=filtered, per_file_timestamps=per_file_timestamps)
99
99
 
100
100
 
101
101
def tbz_exporter(tree, dest, root, subdir, filtered=False,
102
 
                 use_tree_timestamp=False):
 
102
                 per_file_timestamps=False):
103
103
    tar_exporter(tree, dest, root, subdir, compression='bz2',
104
 
                 filtered=filtered, use_tree_timestamp=use_tree_timestamp)
 
104
                 filtered=filtered, per_file_timestamps=per_file_timestamps)