bzr fastimport fails to import branches with slashes in the name from git correctly

Bug #718604 reported by Björn Michaelsen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Triaged
Medium
Unassigned

Bug Description

bzr fastimport maps heirarchical git branches too lossy. As "foo/bar" and "baz/bar" both get mapped to "bar", trouble is guaranteed.

I attached a patch that will make bzr fastimport recreate the branches with full names. I have not tested the patch on Windows, where using a slash might introduce its own set of problems with platform dependence as it is not the path separator there.

Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :
Revision history for this message
Björn Michaelsen (bjoern-michaelsen) wrote :

I attached a second possible solution, which maps "/" in the git-branchnames to "--" in bzr. While this mapping misses some elegance, it should not be prone to platform dependence and removes the need for os/os.path calls.

What is still missing in the patches is a short update to bzr fast-import --help documenting the behavior.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 718604] Re: bzr fastimport fails to import branches with slashes in the name from git correctly

Hi Björn,

On Mon, 2011-02-14 at 09:26 +0000, Björn Michaelsen wrote:
> I attached a second possible solution, which maps "/" in the git-
> branchnames to "--" in bzr. While this mapping misses some elegance, it
> should not be prone to platform dependence and removes the need for
> os/os.path calls.
>
> What is still missing in the patches is a short update to bzr fast-
> import --help documenting the behavior.
>
> ** Patch added: "pragmatic fix"
> https://bugs.launchpad.net/bzr-fastimport/+bug/718604/+attachment/1848892/+files/fix_heirarical_branches_pragmatic.patch
Thanks for the patch.

Using "--" as the escape sequence is problematic because it will break
re-exporting of any previously imported branches with "--" (rather than
"/") in their name.

Rather than escaping the / I wonder if it might make more sense to just
keep the slash in and make sure any missing parent directories get
created. This matches the behaviour in Git (where directories are
created in this case as well) and works well with Bazaar shared
repositories.

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in bzr-fastimport:
status: New → Triaged
importance: Undecided → Medium
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.