[PATCH 5 of 5] patch: invoke dirstate.dirtyifambig on changed file for safety

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 27 21:47:53 CDT 2015



On 05/27/2015 10:03 AM, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1432745859 -32400
> #      Thu May 28 01:57:39 2015 +0900
> # Node ID 0b360140869e72996260435940cfefb88a1e9cdc
> # Parent  6d5d5a1d294d51f4a76cafec192278fd961047bf
> patch: invoke dirstate.dirtyifambig on changed file for safety
>
> Patched file may be mis-recognized as clean by dirstate, if mode, size
> and timestamp of it on the filesystem aren't changed.
>
> To avoid such ambiguous situation, this patch invokes
> `dirstate.dirtyifambig()` on changed file in `workingbackend.setfile()`
>
> This should be executed explicitly, because `fsbackend.setfile()`
> doesn't use `localrepository.wwrite()` to write data into the working
> directory (probably, to avoid decoding file content).

This series seems reasonable and a good step in the right direction. The 
code seems okay.

However, this change of global state (dirstate) in the wwrite function 
will likely have serious issue with the worker system based on fork) 
that we use on linux (and mac os X?)

Am I right?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list