[MERGE] lazy inventory writes
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Oct 10 03:13:43 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> Aaron Bentley wrote:
>>> Robert Collins wrote:
>>>>> WorkingTree currently writes the inventory on nearly every mutation
>>>>> operation. This patch adds the facility for us to write it only on
>>>>> unlock, and updates set_root_id to use this. This combined with a minor
>>>>> change to tree initialisation gives us only one inventory write to disk
>>>>> during tree creation.
>>> This sounds reasonable. +1 except for two things:
>>>
>>>>> @@ -1018,7 +1054,7 @@
>>>>> ["rename rolled back"])
>>>>> except:
>>>>> # restore the inventory on error
>>>>> - self._set_inventory(orig_inv)
>>>>> + self._set_inventory(orig_inv, dirty=original_modified)
>>>>> raise
>>>>> self._write_inventory(inv)
>>> Shouldn't this be removed?
>
> Ultimately, the dirty flag should me set as part of this call, rather
> than writing out the inventory at the end. But Robert wasn't tracking
> down all of the write_inventory locations just yet. He was starting with
> a couple that had to do with the specific thing at hand. add, remove,
> rename_one & move, and others all modify the inventory, and should be
> changed so that they set the dirty flag rather than doing a read,
> modify, write.
>
> This is just a step along that way, not a complete conversion.
It seemed strange to leave that in, while doing major surgery on the
function, but okay. +1 all over.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFKwHX0F+nu1YWqI0RAkz8AJ9I3N1qAqY9ycxyz4vz7jGNeOcitQCgiF7o
pR8uFQTNghO8F+shM8Rki8c=
=RikD
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list