Preserving timestamps
Henryk Gerlach
hgerlach at gmx.de
Tue Aug 7 22:47:12 UTC 2007
> Instead of making .timestamps a file, you could make it a directory
> which mirrors the structure of your repository. To signify a file you
> wish to preserve timestamps, you add an empty placeholder:
> mkdir -p $(hg root)/.timestamps/foo/bar
> touch $(hg root)/.timestamps/foo/bar/baz.py
>
> So now your hooks do the equivelent of:
> touch -r $(hg root)/foo/bar/baz.py $(hg root)/.timestamps/foo/bar/baz.py
> <modify baz.py>
> touch -r $(hg root)/.timestamps/foo/bar/baz.py $(hg root)/foo/bar/baz.py
Well, but mercurial won't manage the timestamps of (hg root)/.timestamps/*
either, so all your timstamps would still be lost
... unless you use tar (or some other timestamp aware packer) to pack the whole directory before commit. This should be doable, but I see no real advantage over my approach, except that you don't depend on python (which we all do anyway).
OK, the .timestamps/* structure might also be more accessable than the pickle-file. But then i would prefer a human-readable
.timestamp file, just containing the human readable timestamps, which you can apply using touch -d.
Have a nice day,
Henryk
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
More information about the Mercurial
mailing list