timestamps and export

Martin Pool mbp at canonical.com
Tue Jun 3 01:53:45 BST 2008

On Mon, Jun 2, 2008 at 9:37 PM, James Westby <jw+debian at jameswestby.net> wrote:
> On Mon, 2008-06-02 at 12:28 +1000, Martin Pool wrote:
>> This is a bit surprising to me - I was looking at the tarball export
>> code last week and it does see to make an effort to pass the timestamp
>> of the revision.  So this may just be a bug...
> >From the tar exporter code:
>  def tar_exporter(tree, dest, root, compression=None):
>    ...
>    from time import time
>    now = time()
>    ...
>      item, fileobj = ie.get_tar_item(root, dp, now, tree)
> I guess this could be changed to use "get_file_mtime()" on the tree
> to get the timestamp value.

I think it should; presumably that gets either the revision value or
the last-changed-revision value.

> builddeb implements a bit of a hack to allow the exporters to work
> on working trees (there's no command line way to export a working
> tree, so it's not a bug that bzr users will hit), I don't know
> if this will work in that case, as we probably want time.time(),
> rather than the mtime returned by stat of the working tree file
> in that case. (The bug that started all of this isn't from exporting
> a working tree, so this choice wouldn't change that, however there
> may be a bug in another part of the code that this wouldn't fix).

For exporting the working tree I think either the on disk mtime or the
current time would be reasonable.

Martin <http://launchpad.net/~mbp/>

More information about the bazaar mailing list