smart_add uses _get_inventory, _write_inventory, but should not

Bug #146165 reported by Martin Pool
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Jelmer Vernooij

Bug Description

smart add should work directly on the working tree api, rather than converting to and from Inventory objects. This would probably be substantially faster for dirstate trees, would fix the underlying cause of some bugs in add, and would be a step towards deprecating paths that deal with whole inventories.

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

See also bug 146176

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

Also relates to calls to set_state_from_inventory

Changed in bzr:
assignee: nobody → mbp
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Martin Pool (mbp)
description: updated
Changed in bzr:
status: Confirmed → In Progress
tags: added: add inventory tech-debt
Revision history for this message
John A Meinel (jameinel) wrote :

Confirmed that this is still the case in bzr.dev 5807. I'm guessing it shouldn't be marked In Progress. So I'm re-marking it as assigned to ~canonical-bazaar but not on Martin's active plate. Still considered a Medium priority and tech-debt sort of bug.

Changed in bzr:
assignee: Martin Pool (mbp) → canonical-bazaar (canonical-bazaar)
status: In Progress → Confirmed
Jelmer Vernooij (jelmer)
tags: added: foreign
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I might have a stab at this. If smart_add() used the WorkingTree API that would mean I didn't have to implement a custom smart_add() for bzr-svn, bzr-hg and bzr-git.

Changed in bzr:
assignee: canonical-bazaar (canonical-bazaar) → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
summary: - add uses _get_inventory, _write_inventory, but should not
+ smart_add uses _get_inventory, _write_inventory, but should not
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → In Progress
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 146165] Re: add uses _get_inventory, _write_inventory, but should not

I would be very happy if you get it going; it will probably speed it
up, make it more readable, and also let it work with foreign branches.
 The add code at the moment does a lot of manipulations on the
inventory after reading it in, which makes it easy to keep track of
things like adding parents before children, but it does also mean it's
very tied to having mutable inventories.

Perhaps we can pair on this at the sprint if you don't solve it beforehand.

Martin

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Mon, 2011-05-02 at 08:29 +0000, Martin Pool wrote:
> I would be very happy if you get it going; it will probably speed it
> up, make it more readable, and also let it work with foreign branches.
> The add code at the moment does a lot of manipulations on the
> inventory after reading it in, which makes it easy to keep track of
> things like adding parents before children, but it does also mean it's
> very tied to having mutable inventories.
>
> Perhaps we can pair on this at the sprint if you don't solve it
> beforehand.
I've done some investigation into it; mostly trying to get it to use
MutableTree.add(), but it seems like apply_inventory_delta is actually
the right way to go as some existing inventory entries might actually
have to change kind (files being replaced by directories, etc).

It'd be nice to pair on this, it should be reasonably easy.

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in bzr:
status: In Progress → Fix Released
milestone: none → 2.4b4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.