Delete of entry in renamed directory not reproduced correctly in fast-export
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Bazaar Fast Import |
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
- Richard Wilbur: Needs Information (needs test(s)) on 2015-07-28
- Bazaar Developers: Pending requested 2015-05-04
-
Diff: 61 lines (+23/-0)1 file modifiedexporter.py (+23/-0)
| Harry Hirsch (bzr-unbunt) wrote : | #1 |
| Changed in bzr-fastimport: | |
| status: | New → Triaged |
| importance: | Undecided → Medium |
| Nuno Araujo (russo79) wrote : | #2 |
| Nuno Araujo (russo79) wrote : | #3 |
| jugglefish (pniederlag) wrote : | #4 |
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.
| Andrew Huff (andrew-huff) wrote : | #5 |
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).
| David I (david-ingamells) wrote : | #6 |
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.


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).