[MERGE] use a serial number and one random value for fileids

Aaron Bentley aaron.bentley at utoronto.ca
Fri May 19 05:32:02 BST 2006


Robert Collins wrote:
> On Thu, 2006-05-18 at 23:22 -0400, Aaron Bentley wrote:
> 
>>Robert Collins wrote:
>>
>>>This patch uses a serial number and a single random value for 'bzr add'
>>>rather than brand new randomness each time.
>>
>>>The only hole I can see is someone doing fork() after calling add, and
>>>then calling add in the child. We probably should add an atfork hook to
>>>reset the seed in this case.
>>
>>Did you consider just doing it in Tree.add?  That seems even safer and 
>>more transparent to me.
> 
> 
> I assume by 'it' you mean caching the random prefix.

No, I mean generating a new prefix and starting the counter back at 0 
for each invocation of add.  This would mean that for bulk adds, you'd 
specify all the files to be added at once.

So does this give us a speed boost?

Aaron




More information about the bazaar mailing list