D2729: copyfile: preserve stat info (mtime, etc.) when doing copies/renames
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Sat Mar 17 17:49:17 UTC 2018
martinvonz added a comment.
In https://phab.mercurial-scm.org/D2729#45787, @spectral wrote:
> In https://phab.mercurial-scm.org/D2729#45664, @indygreg wrote:
>
> > I'm sorry, but we cannot ship this as is.
> >
> > The reason is mtime based build systems, like GNU make.
> >
> > We can't have version control modifying files without bumping their mtime because this invalidates the target freshness checks of mtime-based build systems.
>
>
> If the user does an `mv` in the shell, at least on Linux, it preserves mtime. If they do a `cp`, it doesn't (the file gets the current timestamp). This includes when overwriting a file. I think I'd be fine with mimicking this behavior (only preserve mtime on `hg mv`) if that would make this safer or easier to reason about.
Greg has some concerns about this patch and it sounds like you will make some changes. The patch was queued by Augie, but I'm dropping it for now, so we don't have a slightly controversial patch written by a Googler queued by two other Googlers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2729
To: spectral, #hg-reviewers, durin42
Cc: martinvonz, indygreg, durin42, mercurial-devel
More information about the Mercurial-devel
mailing list