Comment 1 for bug 262261

Revision history for this message
John A Meinel (jameinel) wrote :

The code I see has this:

    now = time.time()
...
    for dp, ie in _export_iter_entries(tree, subdir):
        filename = osutils.pathjoin(root, dp).encode('utf8')
        item = tarfile.TarInfo(filename)
        item.mtime = now

Obviously, that is not a stable solution.

There are two possibilities:

1) Use repository.get_revision(revision_id).timestamp for all files
2) Use repository.get_revision(ie.revision).timestamp for each file

(1) is nice because it is stable for a given revision_id, and should fix our current problem of "bzr builddeb" creating different tarballs accidentally.

(2) might be more correct, but has the overhead of needing to extract a lot of Revision texts when exporting a large tree. Making it configurable would be a bit of a trick, so my recommendation would be to go with (1), and if it is an issue, switch to (2).

Note that some people have requested similar functionality for "bzr export directory". So it might not be a bad idea to make it configurable and expose it to all exporters.