Preserving timestamps
Matt Mackall
mpm at selenic.com
Mon Aug 6 18:10:45 UTC 2007
On Mon, Aug 06, 2007 at 11:40:35AM -0300, Miguel Freitas wrote:
> Hi,
>
> Before you fry me in boiling oil... :-)
> I did read the FAQ ("Why is the modification time of files not
> restored on checkout?") and recent messages on ml ("Maintaining
> modified dates of files"). but...
>
> I'm currently using hg to manage a FPGA project with Xilinx tools.
> Their IDE stores about all files, schematics and stuff in plain text,
> which is a very good thing to allow using hg.
>
> However Xilinx has the bad habit of keeping the modification date of
> symbol files (the file that describes those small blocks containing
> input/output pins) inside the schematic that actually uses the symbol.
>
> Something like that:
>
> BEGIN BLOCKDEF iobuf8
> TIMESTAMP 2007 7 30 22 57 21
>
> As you might guess this breaks things pretty badly whenever i do a new
> checkout.
>
> Since the modification date is different, xilinx asks to rebuild the
> symbols - it will create a new ones with default configuration. This
> way we lose any changes we did (like pin position, symbol size) to the
> symbol file itself.
>
> Another related annoyance is that it also produces several changes to
> the TIMESTAMP fields in the schematic files, requiring useless commits
> (which will cause the same problem to the other developers - an
> infinite loop!).
>
> My question is, i know preserving mtimes is bad in general, but is it
> possible to implement this feature for a specific set of files in a
> repository?
You should be able to do it with a pair of hooks. The precommit hook
stores the relevant filenames and dates in a file to be committed
(".mytimestamps", perhaps), the update hook reads the file and applies
the dates to the listed files.
> Also, before i dig into hg internals, does it currently store the
> mtime on his internal structures? would i have any chance if i want to
> hack a new extension for restoring the mtime? any hint on what hook to
> use?
We don't store any dates except the date in the changelog entry
itself.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list