renamed dirs don't fast-export as git-f-i expects

Bug #219042 reported by xenoterracide
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Confirmed
Medium
Ian Clatworthy

Bug Description

steps to reproduce

~/.bazaar/plugins/fastimport/exporters/bzr-fast-export.py --export-marks=marks.bzr pkgcore > pkgcore.bzr.out
cp pkgcore.bzr.out ../pkgcore.git/
cd ../pkgcore.git
git-fast-import --export-marks=marks.git <pkgcore.bzr.out

Tags: export
Revision history for this message
xenoterracide (xenoterracide) wrote :
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

dato on IRC writes ...

the problem seems to be that we're instructing git-fast-import to rename a directory, when we shouldn't be doing that.

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Actually, the whole IRC conversation provides more info ...

(18:29:00) dato: igc: though if you prefer to look into this one, I'm happy to. the problem seems to be that we're instructing git-fast-import to rename a directory, when we shouldn't be doing that.
(18:31:26) mwhudson left the room (quit: Read error: 104 (Connection reset by peer)).
(18:31:48) james_w: hi dato
(18:32:13) dato: hello james_w
(18:32:22) james_w: if that is the issue then it may be worth talking to Shawn, as it seems that possibly should be allowed.
(18:32:53) james_w: well, git should just ignore it, but I don't see why it should reject it.
(18:35:32) mwhudson [n=mwh@118-92-12-123.dsl.dyn.ihug.co.nz] entered the room.
(18:36:33) dato: uhm, no, I'm mistaken
(18:36:59) dato: path/dir1 was renamed to path/dir2, and it seems that was accepted (of course)
(18:37:38) dato: and then path/dir1/fileX was renamed to path/dir2/fileY, and that boomed
(18:38:30) james_w: so a directory rename is recursive to git-fastimport?
(18:39:51) dato: well, it is to bzr as well, ain't it?
(18:40:42) james_w: I'm not sure how it's represented internally
(18:40:52) james_w: I would expect bzr-fastimport to do that though
(18:44:12) dato: maybe bzr-fast-export should do some ordering, I'm not sure

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Maybe git-fast-import should be enhanced to support renamed directories and not just renamed files? I'll contact Shawn Pearce to get his opinion on this.

Changed in bzr-fastimport:
assignee: nobody → ian-clatworthy
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jonas (jonas-annica) wrote :

looking in git-fast-import-log:

   R dev-notes/reimplemntation dev-notes/reimplementation
* R dev-notes/reimplemntation/binaries dev-notes/reimplementation/binaries.rst

the "dev-notes/reimplemntation" is already renamed...
---

this should be fixed by "recursive rename"-patch by Pieter de Bie
- check which version reporter was using...
- close as already foed

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

Can this now be closed?

Revision history for this message
Andrew Ruthven (andrew-etc) wrote :

I'm still experiencing this broken behaviour in r182 of bzr-fastimport.

I need to go into the exported filestream, and for Jonas's example above dated 2008-10-19, change it to:

R dev-notes/reimplemntation dev-notes/reimplementation
R dev-notes/reimplmentation/binaries dev-notes/reimplementation/binaries.rst

That is the source directory on the second line must be the destination directory from the first line.

Changed in bzr-fastimport:
importance: Low → Medium
status: Triaged → Confirmed
summary: - fast-export doesn't export right
+ renamed directories donfast-export don't export right
summary: - renamed directories donfast-export don't export right
+ renamed dirs don't fast-export as git-f-i expects
tags: added: export
Revision history for this message
Andrew Ruthven (andrew-etc) wrote :

Looking in bzr_exporter.py I see that in the function _process_renames_and_deletes there are two calls to self._adjust_path_for_renames which is the function that fixes the path names. Yet, they're both commented out.

It seems to me that they are causing the regression.

Revision history for this message
Chow Loong Jin (hyperair) wrote :

Testing that, it does appear that uncommenting the two _adjust_path_for_renames lines makes it work. Test was done with lp:tangerine.

Revision history for this message
Scott Moser (smoser) wrote :

I've filed bug 1770652
which is probably related to this bug. I've attached a simple re-create there.

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.