~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export/zip_exporter.py

merge hpss-get-checkout-format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        dest = sys.stdout
56
56
    zipf = zipfile.ZipFile(dest, "w", compression)
57
57
    try:
58
 
        for dp, ie in _export_iter_entries(tree, subdir):
 
58
        for dp, tp, ie in _export_iter_entries(tree, subdir):
59
59
            file_id = ie.file_id
60
60
            mutter("  export {%s} kind %s to %s", file_id, ie.kind, dest)
61
61
 
64
64
            if force_mtime is not None:
65
65
                mtime = force_mtime
66
66
            else:
67
 
                mtime = tree.get_file_mtime(ie.file_id, dp)
 
67
                mtime = tree.get_file_mtime(ie.file_id, tp)
68
68
            date_time = time.localtime(mtime)[:6]
69
69
            filename = osutils.pathjoin(root, dp).encode('utf8')
70
70
            if ie.kind == "file":
73
73
                            date_time=date_time)
74
74
                zinfo.compress_type = compression
75
75
                zinfo.external_attr = _FILE_ATTR
76
 
                content = tree.get_file_text(file_id)
 
76
                content = tree.get_file_text(file_id, tp)
77
77
                zipf.writestr(zinfo, content)
78
78
            elif ie.kind == "directory":
79
79
                # Directories must contain a trailing slash, to indicate
91
91
                            date_time=date_time)
92
92
                zinfo.compress_type = compression
93
93
                zinfo.external_attr = _FILE_ATTR
94
 
                zipf.writestr(zinfo, tree.get_symlink_target(file_id))
 
94
                zipf.writestr(zinfo, tree.get_symlink_target(file_id, tp))
95
95
            yield
96
96
 
97
97
        zipf.close()