Need to cope with incomprehensible data in convert_revision

Bug #513475 reported by Neil Martinsen-Burrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Hg Plugin
Triaged
Low
Unassigned

Bug Description

I'm trying to branch http://freshfoo.com/repos/imapclient/trunk using bzr-hg and I get the following traceback:

$ bzr branch http://freshfoo.com/repos/imapclient/trunk imapclient
bzr: ERROR: exceptions.KeyError: "Unknown VCS 'svn-v3-trunk0'"

Traceback (most recent call last):
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/builtins.py", line 1232, in run
    source_branch=br_from)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/bzrdir.py", line 1184, in sprout
    result_repo.fetch(source_repository, fetch_spec=fetch_spec)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/repository.py", line 1704, in fetch
    find_ghosts=find_ghosts, fetch_spec=fetch_spec)
  File "/Users/nmb/src/bzr/bzr.dev/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/Users/nmb/.bazaar/plugins/hg/fetch.py", line 645, in fetch
    self.addchangegroup(cg, mapping)
  File "/Users/nmb/.bazaar/plugins/hg/fetch.py", line 502, in addchangegroup
    self._unpack_changesets(chunkiter, mapping, pb)
  File "/Users/nmb/.bazaar/plugins/hg/fetch.py", line 415, in _unpack_changesets
    manifest, user, (time, timezone), desc, extra)
  File "/Users/nmb/.bazaar/plugins/hg/mapping.py", line 349, in import_revision
    result.properties['converted-from'] = convert_converted_from(value)
  File "/Users/nmb/.bazaar/plugins/hg/mapping.py", line 56, in convert_converted_from
    raise KeyError("Unknown VCS '%s'" % kind)
KeyError: "Unknown VCS 'svn-v3-trunk0'"

bzr 2.2.0dev1 on python 2.6.4 (Darwin-9.8.0-i386-32bit)
arguments: ['/Users/nmb/usr/bin/bzr', 'branch', 'http://freshfoo.com/repos/imapclient/trunk', 'imapclient']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  automirror /Users/nmb/.bazaar/plugins/automirror [0.1.0]
  bzrtools /Users/nmb/.bazaar/plugins/bzrtools [2.1.0b1]
  colo /Users/nmb/.bazaar/plugins/colo [0.0.2dev]
  colocated /Users/nmb/.bazaar/plugins/colocated [0.4.16dev]
  explorer /Users/nmb/.bazaar/plugins/explorer [0.11.2]
  fastimport /Users/nmb/.bazaar/plugins/fastimport [0.9.0dev]
  git /Users/nmb/.bazaar/plugins/git [0.4.4dev]
  hg /Users/nmb/.bazaar/plugins/hg [0.2.0dev]
  latex_version_info /Users/nmb/.bazaar/plugins/latex_version_info [0.0.2]
  launchpad /Users/nmb/src/bzr/bzr.dev/bzrlib/plugins/launchpad [2.2.0dev1]
  netrc_credential_store /Users/nmb/src/bzr/bzr.dev/bzrlib/plugins/netrc_credential_store [2.2.0dev1]
  news_merge /Users/nmb/src/bzr/bzr.dev/bzrlib/plugins/news_merge [2.2.0dev1]
  qbzr /Users/nmb/.bazaar/plugins/qbzr [0.17.0dev]
  rst2html /Users/nmb/.bazaar/plugins/rst2html [0.0.2]
  xmloutput /Users/nmb/.bazaar/plugins/xmloutput [0.8.6.dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

This is with bzr.dev r4988 and bzr-hg r281.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 513475] [NEW] Branch fails with UnknownVCS error

  status incomplete

I'm curious how this repository was created. The convert_revision
Mercurial extra seems to be set to a bazaar revision-like id.

E.g. see http://imapclient.freshfoo.com/changeset/28:a858d6ecea6b/

Changed in bzr-hg:
status: New → Incomplete
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Sun, 2010-01-31 at 14:08 +0000, Jelmer Vernooij wrote:
> status incomplete
>
> I'm curious how this repository was created. The convert_revision
> Mercurial extra seems to be set to a bazaar revision-like id.
>
> E.g. see http://imapclient.freshfoo.com/changeset/28:a858d6ecea6b/
Menno has kindly provided me with the original bazaar repository that
the current hg repository was created from.

It looks like the "hg convert" backend that converts from Bazaar to
Mercurial does not prefix the revision id with the version control
system name as the bzr-hg plugin expects at the moment. I wonder what
the best way is to work around this problem.

Perhaps we should patch hg so that it always prefixes the revision id
with "bzr:" so that it is easier to track where a revision came from.

Independent of that, I think it would be a good idea to add a warning to
bzr-hg to inform the user about the fact that a 'convert_revision' extra
was encountered with invalid data. To avoid spamming the user with these
warnings, we should probably remember that we have warned once and then
shut up.

Since we need to be able to roundtrip, we need to make sure that we are
able to recreate the original 'convert_revision' extra even if the
convert_revision property in bazaar could not be created. I think the
easiest way to do this is to unconditionally import the convert_revision
extra into the bazaar revision properties. This should also allow us to
simplify the mapping code, at a slight disk usage overhead.

Thoughts?

  status triaged
  importance medium
  summary "Need to cope with incomprehensible data in convert_revision
extra"

Cheers,

Jelmer

summary: - Branch fails with UnknownVCS error
+ Need to cope with incomprehensible data in convert_revision
Changed in bzr-hg:
importance: Undecided → Medium
status: Incomplete → Triaged
Jelmer Vernooij (jelmer)
Changed in bzr-hg:
importance: Medium → Low
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.