bzr-fast-export exports rm+mv incorrectly
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Bazaar Fast Import |
Medium
|
Ian Clatworthy | ||
Bug Description
if doing
bzr rm a
bzr mv b a
commit
then bzr-fast-export will export a mv followed by a rm, causing a to vanish in total
(btw, bzr diff -c also shows them in "opposite" order)
| Jonas (jonas-annica) wrote : | #1 |
| Jonas (jonas-annica) wrote : | #2 |
| Ian Clatworthy (ian-clatworthy) wrote : | #3 |
Patch applied to trunk and available in rev 87.
| Changed in bzr-fastimport: | |
| assignee: | nobody → ian-clatworthy |
| importance: | Undecided → Medium |
| status: | New → Fix Committed |
| Jonas (jonas-annica) wrote : | #4 |
hmm..found a bug in my patch...
will try to write another variant...
but I don't know the internals, so it's really just guess work
/Jonas
| Jonas (jonas-annica) wrote : | #5 |
Found case where current patch does not work
| Jonas (jonas-annica) wrote : | #6 |
new variant of patch
| Gabriel de Perthuis (g2p) wrote : | #7 |
The current code (r87) is also screwy and can't import ipython (these revisions: http://
Here is a test case:
bzr init
mkdir fools
touch fools/FOO
bzr add fools/FOO
bzr commit -m Initial
bzr mv fools/FOO .
bzr rm fools
bzr commit -m MvRm
# Fails
git init; ~/var/co/
# Exported data
/home/g2p/
*** BzrFastExport: Exported 0 commits; forcing checkpoint
checkpoint
commit refs/heads/tmp
mark :1
committer <whomever> 1224661056 +0200
data 7
Initial
M 644 inline fools/FOO
data 0
commit refs/heads/master
mark :2
committer <whomever> 1224661106 +0200
data 4
MvRm
from :1
D fools
R fools/FOO FOO
# When what should be exported is:
R fools/FOO FOO
D fools
| Gabriel de Perthuis (g2p) wrote : | #8 |
Reopen, see second test case.
| Changed in bzr-fastimport: | |
| status: | Fix Committed → Confirmed |
| Gabriel de Perthuis (g2p) wrote : | #9 |
Tree.changes_from is lossy (the docs hint at it as well: http://
| Gabriel de Perthuis (g2p) wrote : | #10 |
I've rewritten the exporter to stream directly the iter_changes operations. This does fix my testcase, which was with the exporter being too much involved with directory moves.
But these are not the correct semantics yet, because iter_changes appears to give an unordered set of changes.
For example (this bug's first testcase), it returns things like:
R a b
D b
Which, serialized, should become
D b
R a b
Another problematic situation is (#285175):
R b a
R a b
Which needs an intermediary to be serialized
R b t
R a b
R t a
See:
https:/
Furthermore, I don't know of any case not working with my latest patch
on this bug
Do you ?
/Jonas
--- Den tors 2008-10-23 skrev Gabriel de Perthuis <email address hidden>:
> Från: Gabriel de Perthuis <email address hidden>
> Ämne: [Bug 268933] Re: bzr-fast-export exports rm+mv incorrectly
> Till: <email address hidden>
> Datum: torsdag 23 oktober 2008 01.29
> I've rewritten the exporter to stream directly the
> iter_changes
> operations. This does fix my testcase, which was with the
> exporter being
> too much involved with directory moves.
>
> But these are not the correct semantics yet, because
> iter_changes
> appears to give an unordered set of changes.
>
> For example (this bug's first testcase), it returns
> things like:
> R a b
> D b
> Which, serialized, should become
> D b
> R a b
>
> Another problematic situation is (#285175):
> R b a
> R a b
> Which needs an intermediary to be serialized
> R b t
> R a b
> R t a
>
>
> ** Attachment added: "WIP patch"
>
> http://
>
> --
> bzr-fast-export exports rm+mv incorrectly
> https:/
> You received this bug notification because you are a direct
> subscriber
> of the bug.
>
> Status in Bazaar Fast Import Plugin: Confirmed
>
> Bug description:
> if doing
> bzr rm a
> bzr mv b a
> commit
>
> then bzr-fast-export will export a mv followed by a rm,
> causing a to vanish in total
> (btw, bzr diff -c also shows them in "opposite"
> order)
_
Låna pengar utan säkerhet. Jämför vilkor online hos Kelkoo.
http://
| Gabriel de Perthuis (g2p) wrote : | #12 |
I've tested your latest patch.
My testcase ( https:/
I'll see if I can work on top of your patch. Anyway, I'll check with the testcases of both bugs.
| tags: | added: export |
| Chow Loong Jin (hyperair) wrote : | #13 |
I believe lp:tangerine also suffers from this. A previous version of bzr-fast-export I grabbed from somewhere I don't remember appears to handle it correctly though.
| Chow Loong Jin (hyperair) wrote : | #14 |
Or not. Poking in git fast-import log shows that it's more similar to bug #219042 instead. Sorry for the noise.


Proposed patch.
Move delete-handling earlier in emit_commit