Export from bzr / Import to git results in a deleted file re-appearing

Bug #1014291 reported by Felix Natter on 2012-06-17
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Undecided
Unassigned
bzr-fastimport (Ubuntu)
Undecided
Unassigned

Bug Description

hi,

I did the following:

mkdir freeplane-git1
cd freeplane-git1
git init .
bzr fast-export --export-marks=../marks.bzr ../trunk/ | git fast-import --export-marks=../marks.git
git checkout

This seems to succeed, but the resulting working index is broken, e.g.:
 freeplane-git1/freeplane_plugin_formula/src/org/freeplane/plugin/formula
 contains SpreadSheetUtils.java which belongs to package
 'org.freeplane.plugin.spreadsheet' (which is no longer in the bzr trunk that I imported!)

You can check out the public freeplane repo like this:
  bzr branch bzr://freeplane.bzr.sourceforge.net/bzrroot/freeplane/freeplane_program/trunk

Of course I am not sure that this a bzr- (vs a git-) issue.

I am using Bazaar (bzr) 2.5.0dev6, bzr-fastimport 0.13.0 and git 1.7.10.

Thank you and Best Regards,

Felix

Related branches

Reduced testcase:

bzr init
mkdir a
touch a/a a/b
bzr add a/*
bzr ci -m a
bzr rm a/b
bzr mv a b
bzr ci -m b
bzr fast-export -v .

15:59:28 implicitly renaming a/a => b/a
15:59:28 implicitly renaming a/b => b/b

The second rename should be skipped.

=== modified file 'exporter.py'
--- exporter.py 2012-05-08 14:38:44 +0000
+++ exporter.py 2012-07-13 14:08:50 +0000
@@ -559,6 +559,9 @@
             renamed_already = set(old_to_new.keys())
             still_to_be_renamed = set(must_be_renamed.keys()) - renamed_already
             for old_child_path in sorted(still_to_be_renamed):
+ # Deleted files should not be renamed
+ if old_child_path in deleted_paths:
+ continue
                 new_child_path = must_be_renamed[old_child_path]
                 if self.verbose:
                     self.note("implicitly renaming %s => %s" % (old_child_path,

Felix Natter (fnatter) wrote :

Thank you! This fixes my problem.

Torsten Bronger (bronger) wrote :

Fixed this problem for me, too. Why isn't the patch included yet?

Unit 193 (unit193) wrote :

In attempt to at least get the fix in the distribution if not upstream, debdiff attached.

Simon Quigley (tsimonq2) wrote :

Uploaded to Artful. Thanks Unit193!

Simon Quigley (tsimonq2) on 2017-08-30
Changed in bzr-fastimport (Ubuntu):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr-fastimport - 0.13.0+bzr361-1ubuntu1

---------------
bzr-fastimport (0.13.0+bzr361-1ubuntu1) devel; urgency=medium

  * d/p/fix_deletion_case.patch (LP: #430347, LP: #1014291, LP: #1167690):
    Fix a case where deleteion of an entry in a renamed directory is not
    reproduced correctly in fast-export. Thanks to Harry Hirsch, Nuno Araujo,
    and Andrew Huff.
  * d/control: Build-depend on dh-python.

 -- Unit 193 <email address hidden> Mon, 19 Jun 2017 18:05:06 -0400

Changed in bzr-fastimport (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers