Usage of bzr-hg plug-in

Ben Finney ben at benfinney.id.au
Tue Mar 10 08:05:33 GMT 2009


Howdy all,

The ‘bzr-hg’ plugin <URL:https://launchpad.net/bzr-hg/> doesn't give
much information on how to use it. (Is there a place at Launchpad
where the documentation for a package is stored? Or does Launchpad not
encourage standard documentation for packages?)

After installing (‘bzr checkout lp:bzr-hg $HOME/.bazaar/plugins/hg/’),
I can now get help on the plugin:

=====
$ bzr help hg
Hg support for bzr.

hg and bzr have different restrictions placed n revision ids. Its not possible
with the current hg model to allow bzr to write sanely to hg. However its
possibe to get bzr data out of hg.

The key translations needed are:
 * in bzr we use a revision id of "hg:" + hex(hgrevid) to ensure we can 
   always utf8 encode it.
 * we convert manifests to inventories on the fly.
=====

Lacking information on what to actually *do* with the plugin, I try
seeing if there are any new commands that mention it:

=====
$ bzr help commands | grep hg
$
=====

So no new commands. Maybe it affects the URLs available?

=====
$ bzr help urlspec | grep hg
$
=====

Hmm. Maybe I don't need to do anything special, and I can just use a
Mercurial repository directly:

=====
$ ls -d .hg
.hg

$ bzr info
Standalone tree (format: unnamed)
Location:
  branch root: .
bzr: ERROR: exceptions.AttributeError: 'HgBranchConfig' object has no attribute 'get_user_option'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, 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 "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 807, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1130, in run
    verbose=noise_level, outfile=self.outf)
  File "/usr/lib/python2.5/site-packages/bzrlib/info.py", line 341, in show_bzrdir_info
    outfile)
  File "/usr/lib/python2.5/site-packages/bzrlib/info.py", line 361, in show_component_info
    _show_related_info(branch, outfile)
  File "/usr/lib/python2.5/site-packages/bzrlib/info.py", line 149, in _show_related_info
    locs = _gather_related_branches(branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/info.py", line 140, in _gather_related_branches
    locs.add_url('public branch', branch.get_public_branch())
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 569, in get_public_branch
    return self._get_config_location('public_branch')
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 540, in _get_config_location
    location = config.get_user_option(name)
AttributeError: 'HgBranchConfig' object has no attribute 'get_user_option'

bzr 1.5 on python 2.5.4 (linux2)
arguments: ['/usr/bin/bzr', 'info']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.UTF-8'
plugins:
  builddeb             /usr/lib/python2.5/site-packages/bzrlib/plugins/builddeb [0.95.0dev0]
  bzr_difftools        /home/bignose/.bazaar/plugins/bzr_difftools [0.91.0]
  bzrtools             /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  fastimport           /home/bignose/.bazaar/plugins/fastimport [0.8.0dev0]
  hg                   /home/bignose/.bazaar/plugins/hg [unknown]
  launchpad            /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  loom                 /usr/lib/python2.5/site-packages/bzrlib/plugins/loom [1.4.0dev0]
  pqm                  /usr/lib/python2.5/site-packages/bzrlib/plugins/pqm [1.3.0]
  rebase               /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.3.0]
  stats                /usr/lib/python2.5/site-packages/bzrlib/plugins/stats [unknown]
  svn                  /usr/lib/python2.5/site-packages/bzrlib/plugins/svn [0.4.10]
  upload               /usr/lib/python2.5/site-packages/bzrlib/plugins/upload [0.1.0]
*** 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.
=====

Well, at least the plugin is doing something, I suppose. I'm not even
sure if I did anything wrong.

I hope this is useful to whoever needs to know about it. I would
submit a bug report, but unlike this mailing list it requires me to
manage a separate authentication identity.

-- 
 \         “Pinky, are you pondering what I'm pondering?” “I think so, |
  `\   Brain, but culottes have a tendency to ride up so.” —_Pinky and |
_o__)                                                       The Brain_ |
Ben Finney




More information about the bazaar mailing list