Comment 2 for bug 262261

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 262261] Re: Should use the revision timestamp when exporting

On Thu, 2008-08-28 at 16:52 +0000, John A Meinel 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

I think there's a method on tree that gives you the timestamp. This is
important to me as I export working trees as well.

The thing that I found strange was that for three different
implementations of the method that I found I found three different
results.

> (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.

It may not fix it, and isn't the solution we want long term, but it
would be nice if it at least fixed some cases.

Thanks,

James