[PATCH 2 of 7] clone: put streaming clones in a transaction
durham at fb.com
Mon Mar 31 12:22:56 CDT 2014
On 3/26/14 12:24 PM, "Matt Mackall" <mpm at selenic.com> wrote:
>On Mon, 2014-03-24 at 19:33 -0700, Durham Goode wrote:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1395700700 25200
>> # Mon Mar 24 15:38:20 2014 -0700
>> # Node ID 08595987c5b0e8af5aa8fec4debd7260f5a79e8f
>> # Parent ab3be74e8022c31b7c95975fb09b3602ed7775d8
>> clone: put streaming clones in a transaction
>> Streaming clones were writing to files outside of a transaction. Soon
>> fncache will be written at transaction close time, so we need streaming
>> to be in a transaction.
>Hmm. But you're not adding the streamed files to the transaction?
The clone command deletes the entire repo if something goes wrong, so
transacting these writes wasn't necessary.
>> + # Writing straight to files circumvented the inmemory
>> + self.invalidate()
>Isn't there a lock held here that will invalidate() on release?
No, things get invalidated at lock acquisition time, but not at lock
release (since they shouldn't be invalid since no one else should have
touched the disk while we had the lock). Regardless of that though, we're
doing this invalidate inside the lock so lock release won't have run yet.
More information about the Mercurial-devel