Reuse the same temp index in a transaction
authorKarl Hasselström <kha@treskal.com>
Wed, 23 Jul 2008 21:29:09 +0000 (23:29 +0200)
committerKarl Hasselström <kha@treskal.com>
Thu, 24 Jul 2008 22:03:14 +0000 (00:03 +0200)
commitafa3f9b9ed5eeac9c98d7c43e82ba31e7b9e9826
treed87e6838108a3fe3e60674aaeca51923af9fb94e
parentbc1ecd0bb28c457634ea5ea747c55945d1aa1997
Reuse the same temp index in a transaction

Instead of making a new temp index every time we need one, just keep
reusing the same one. And keep track of which tree is currently stored
in it -- if we do several consecutive successful pushes, it's always
going to be the "right" tree so that we don't have to call read-tree
before each patch application.

The motivation behind this change is of course that it makes things
faster.

(The same simple test as in the previous patch -- pushing 250 patches
in a 32k-file repository, with one file-level merge necessary per push
-- went from 0.36 to 0.19 seconds per patch with this patch applied.)

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/lib/git.py
stgit/lib/transaction.py