Re: Fixing .hg file open ordering

2016-11-23 Thread Bryan O'Sullivan
Yep, your reasoning here makes sense. While I'm glad that you discovered after some investigation that we're doing the right thing already, it's a little troubling that this wasn't easy to understand from reading the code, and that (from my interpretation of what you wrote) you had to think and

Re: Fixing .hg file open ordering

2016-11-22 Thread Ryan McElroy
On 11/22/16 8:19 PM, Ryan McElroy wrote: On 11/10/16 5:11 PM, Bryan O'Sullivan wrote: On Thu, Nov 10, 2016 at 2:29 AM, Durham Goode > wrote: We worked out a solution to Bryan’s main concern, but there hasn’t been any discussion of my main

Re: Fixing .hg file open ordering

2016-11-10 Thread Durham Goode
On 11/9/16, 4:51 PM, "Augie Fackler" wrote: On Wed, Nov 02, 2016 at 03:39:50PM -0700, Bryan O'Sullivan wrote: > On Wed, Nov 2, 2016 at 3:30 PM, Durham Goode wrote: > > > Bookmark writes are now within the wlock, and any inmemory read you did

Re: Fixing .hg file open ordering

2016-11-09 Thread Augie Fackler
On Wed, Nov 02, 2016 at 03:39:50PM -0700, Bryan O'Sullivan wrote: > On Wed, Nov 2, 2016 at 3:30 PM, Durham Goode wrote: > > > Bookmark writes are now within the wlock, and any inmemory read you did > > prior to taking the lock will be invalidated (during the next > >

Re: Fixing .hg file open ordering

2016-11-02 Thread Bryan O'Sullivan
On Wed, Nov 2, 2016 at 3:30 PM, Durham Goode wrote: > Bookmark writes are now within the wlock, and any inmemory read you did > prior to taking the lock will be invalidated (during the next > repo._bookmarks access) and thrown away when you take the lock. So once > you're in the

Re: Fixing .hg file open ordering

2016-11-02 Thread Durham Goode
On 11/2/16 3:20 PM, Bryan O'Sullivan wrote: There's long been a well-defined order for accessing historical data: changelog first, then manifest, then revlog, and the reverse for writes. Yea, I guess I'm proposing formalizing these dependencies into a single location in code so we cannot mess

Re: Fixing .hg file open ordering

2016-11-02 Thread Bryan O'Sullivan
There's long been a well-defined order for accessing historical data: changelog first, then manifest, then revlog, and the reverse for writes. I think that what has happened with bookmarks is that we literally forgot about the next necessary ordering constraint: you must read bookmarks before the

Re: Fixing .hg file open ordering

2016-11-02 Thread Durham Goode
On 11/2/16 2:09 PM, Durham Goode wrote: There's currently no defined order in which Mercurial should open files in the .hg directory. For instance, it's possible to read the changelog first, then several seconds later read the bookmark file. If during those several seconds the repo receives

Fixing .hg file open ordering

2016-11-02 Thread Durham Goode
There's currently no defined order in which Mercurial should open files in the .hg directory. For instance, it's possible to read the changelog first, then several seconds later read the bookmark file. If during those several seconds the repo receives new commits and a bookmark moves, then it