dirstate2 comments

Alexander Belchenko bialix at ukr.net
Mon May 31 09:16:15 BST 2010


Short comment about something I saw when started to read. Still need to 
read it fully, tl...

Martin Pool пишет:
> I had a look at the dirstate2 branch too.  The full diff is attached
> for ease of reading by others.  I want to start just looking at the
> format documentation inline.
> 
> +class IndirectedDirState(AbstractDirState):
> +    """DirState implemented using an indirection pointer and hash-named files.
> +
> +    Unlike DirState, IndirectedDirState is nearly atomic on the file system.
> +    The base name of the dirstate specifies a directory containing a 'current'
> +    file, and many content files named with their hash. Updates to
> +    IndirectedDirState are very robust and do not lock out other readers.
> 
> Perhaps it's useful to document what our expectations of the
> filesystem are; we want them to be lower than for current dirstate and
> I think we want the following:
> 
>  * we never use OS locks: writers may block each other out but readers do not

cool

>  * however, we also cannot count on being able to
> delete/rename/overwrite a file while it's being read (because this
> doesn't work on windows)

Hmm, I'm not sure but I was under impression that using Win32 API it's 
possible to open the file in shared mode and allow simultaneous read and 
rename/delete. I might be wrong of course, but I saw something similar 
implemented in hg sources. Maybe somebody like Martin gz can look on 
this with suspicious eye?




More information about the bazaar mailing list