[MERGE] Faster local branching, checkout

Ian Clatworthy ian.clatworthy at internode.on.net
Sat Jun 7 06:44:51 BST 2008


Aaron Bentley wrote:
> Hi all,
> 
> With Ian's encouragement, I've hacked up a branch that implements his
> performance improvements, but does it in a safer and more general way.

Thanks a heap for this.

> The performance I get from a Mozilla tree is basically the same as ian's
> patch, because the changes have similar results:

Confirmed with testing on the OOo tree as well.

bb:tweak

> +        :param filesystem_only: if True, only calulate values for files
> +            that require renames or execute bit setting.

calulate -> calculate

> +    def apply(self, no_conflicts=False, precomputed_delta=None, _mover=None):
>          """Apply all changes to the inventory and filesystem.
>  

precomputed_delta needs a mention in the docstring.

>                      # File-id isn't really being deleted, just moved
>                      if file_id in self._r_new_id:
>                          continue
> -                    inventory_delta.append((path, None, file_id, None))
> +                    if inventory_delta is not None:
> +                        inventory_delta.append((path, None, file_id, None))

The 'inventory_delta is not None' test can be moved higher up into the
'if trans_id in self._removed_id:' check. There's no need to work out the
file-id at all unless we're going to build the inventory delta.

> +
> +        If inventory_delta is None, no inventory delta is calculated, and
> +        no list of modified paths is returned.

Thanks for mentioning this in the apply_insertions docstring. Can you please
do the same for apply_removals?

> +        entries = self._tree.iter_entries_by_dir(new_path_file_ids.values())
> +        old_paths = dict((e.file_id, p) for p, e in entries)

It looks like old_paths is only used when calculating the inventory entries?
If so, we could only generate these things above when inventory_delta is not None.

Ian C.



More information about the bazaar mailing list