cannot import from Mercurial

Sean Kelley sean.v.kelley at gmail.com
Sun Jul 20 02:32:32 BST 2008


Hi

On Fri, Apr 11, 2008 at 12:37 PM, Georg <gwk.rko at googlemail.com> wrote:
> Hi,
>
> is there a working way to import from Mercurial?  I tried both hg-import and
> fastimport (hg-
>

I get the same errors and I am using bzr 1.6b3:

with bzr-fastimport I get:

 ~/.bazaar/plugins/fastimport/exporters/hg-fast-export.py -r
../port-manager.hg | bzr fast-import -
trunk: Exporting full revision 1/216 with 0/0/0 added/changed/removed files
trunk: Exporting simple delta revision 2/216 with 8/0/0
added/changed/removed files
trunk: Exporting simple delta revision 3/216 with 8/6/0
added/changed/removed files
bzr: ERROR: exceptions.AttributeError: 'KnitPackRepository' object has
no attribute 'get_inventory_weave'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/kelleys/.bazaar/plugins/fastimport/__init__.py", line 166, in run
    params, verbose)
  File "/home/kelleys/.bazaar/plugins/fastimport/__init__.py", line 50, in _run
    return proc.process(p.iter_commands)
  File "/home/kelleys/.bazaar/plugins/fastimport/processor.py", line
83, in process
    self._process(command_iter)
  File "/home/kelleys/.bazaar/plugins/fastimport/processors/generic_processor.py",
line 251, in _process
    processor.ImportProcessor._process(self, command_iter)
  File "/home/kelleys/.bazaar/plugins/fastimport/processor.py", line
105, in _process
    handler(self, cmd)
  File "/home/kelleys/.bazaar/plugins/fastimport/processors/generic_processor.py",
line 413, in commit_handler
    handler.process()
  File "/home/kelleys/.bazaar/plugins/fastimport/processor.py", line
171, in process
    self.post_process_files()
  File "/home/kelleys/.bazaar/plugins/fastimport/processors/generic_processor.py",
line 670, in post_process_files
    lambda revision_ids: self._get_inventories(revision_ids))
  File "/home/kelleys/.bazaar/plugins/fastimport/revisionloader.py",
line 63, in load
    inv, present_parents)
  File "/home/kelleys/.bazaar/plugins/fastimport/revisionloader.py",
line 170, in _add_inventory
    inv_vf = self.repo.get_inventory_weave()
AttributeError: 'KnitPackRepository' object has no attribute
'get_inventory_weave'

bzr 1.6b3 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'fast-import', '-']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  fastimport           /home/kelleys/.bazaar/plugins/fastimport [unknown]
  hgimport             /home/kelleys/.bazaar/plugins/hgimport [unknown]
  launchpad
/usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.
Traceback (most recent call last):
  File "/home/kelleys/.bazaar/plugins/fastimport/exporters/hg-fast-export.py",
line 396, in <module>
    options.statusfile,authors=a,sob=options.sob,force=options.force))
  File "/home/kelleys/.bazaar/plugins/fastimport/exporters/hg-fast-export.py",
line 344, in hg2git
    c=export_commit(ui,repo,rev,marks_cache,heads_cache,last,max,c,authors,sob,brmap)
  File "/home/kelleys/.bazaar/plugins/fastimport/exporters/hg-fast-export.py",
line 243, in export_commit
    export_file_contents(ctx,man,changed)
  File "/home/kelleys/.bazaar/plugins/fastimport/exporters/hg-fast-export.py",
line 122, in export_file_contents
    wr(d)
  File "/home/kelleys/.bazaar/plugins/fastimport/exporters/hg-fast-export.py",
line 27, in wr
    print msg
IOError: [Errno 32] Broken pipe


With bzr-hgimport I get this error:

bzr hg-import ../../port-manager.hg/
bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'hex'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line
499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/kelleys/.bazaar/plugins/hgimport/__init__.py", line 34, in run
    importer.run(location)
  File "/home/kelleys/.bazaar/plugins/hgimport/importer.py", line 260, in run
    for rev, inv in self.iter_revisions(pb):
  File "/home/kelleys/.bazaar/plugins/hgimport/importer.py", line 173,
in iter_revisions
    revision_id = bzr_revision_id(node)
  File "/home/kelleys/.bazaar/plugins/hgimport/importer.py", line 52,
in bzr_revision_id
    return 'hg-' + mercurial.hg.hex(node)
AttributeError: 'module' object has no attribute 'hex'

bzr 1.6b3 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'hg-import', '../../port-manager.hg/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  fastimport           /home/kelleys/.bazaar/plugins/fastimport [unknown]
  hgimport             /home/kelleys/.bazaar/plugins/hgimport [unknown]
  launchpad
/usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.


So is there some other way to import Mercurial or does one have to
convert mercurial to Git first?

Sean



More information about the bazaar mailing list