Delete of entry in renamed directory not reproduced correctly in fast-export

Bug #430347 reported by Harry Hirsch
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Triaged
Medium
Unassigned

Bug Description

Consider the following scenario:

$ bzr mv x y # x is a directory, y does not exist yet
$ bzr rm y/z
$ bzr commit

This is reproduced by fast-export as follows:

R x y
R x/z y/z
D x/z

This means "z" is deleted when it has been renamed already. When importing this in git this leaves "y/z" untouched so that the delete is not reproduced at all.

The expected output would be something like the following:

D x/z
R x y

Attached you can find a patch that tries to fix this issue. It has been tested and is working on the test case above and a production repository (around 200 revisions) containing multiple operations like this.

Related branches

Revision history for this message
Harry Hirsch (bzr-unbunt) wrote :
Jelmer Vernooij (jelmer)
Changed in bzr-fastimport:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Nuno Araujo (russo79) wrote :

I have the same problem (while using git-bzr who depends on fast-import).
When I applied Harry Hirsch's patch, I had an error message (see attached file).
I updated the patch (see next attachment) and it applies correctly and works correctly now (applied on r301).

Revision history for this message
Nuno Araujo (russo79) wrote :
Revision history for this message
jugglefish (pniederlag) wrote :

The attached patch seems to fix this problem in a quick test on lp:tangerine, which (due ti its history) is affected by the problem.

Revision history for this message
Andrew Huff (andrew-huff) wrote :

Nuno Araujo's patch caused a crash on our data (presumably because of an edge case within the edge case). I've attached a patch that fixed the issue for us (apply to exporter.py instead of Nuno's patch).

Revision history for this message
David I (david-ingamells) wrote :

Also had the problem. Andrew's fix of March 2014 worked for me. To help others, this is what I did on Linux:

    cd ~/bazaar/plugins
    bzr branch lp:bzr-fastimport fastimport
    cd fastimport
    patch -p < exportpatch.txt
    python setup.py build_ext -i

I find it a great shame that the original patch has been available since 2011, Andrews fix on that since March 2014, but still in Oct 2015, the official package has not been repaired, and as a result this 6-year-old ticket is still open.

No matter, by the end of this year we will be using git. One reason is that the bazaar project is seemingly dead. Shame I liked bzr.

Revision history for this message
Balint Reczey (rbalint) wrote :

For the record the patch is applied in Ubuntu since 0.13.0+bzr361-1ubuntu1. Thanks to all who contributed to it!

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.