开发者

Converting SVN to Mercurial on Mac with working python binding doesn't work

I try to convert a local SCN repository (with all its history) to Mercurial. I am working on a Mac (10.6.2). Therefore, I am using Macports as package management tool.

I started the conversion with:

hg convert file:// ´pwd´/calebsvn/ 

The result is, that it starts to 开发者_运维百科work fine, but after a while, it stops. That is the output:

initializing svn wc 'calebsvn-wc'
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.4.2)
** Extensions loaded: convert
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
    return _runcatch(u, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 46, in _runcatch
    return _dispatch(ui, args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 454, in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 324, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 505, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 459, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/dispatch.py", line 453, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial/util.py", line 386, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hgext/convert/__init__.py", line 229, in convert
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hgext/convert/convcmd.py", line 368, in convert
    destc = convertsink(ui, dest, opts.get('dest_type'))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hgext/convert/convcmd.py", line 66, in convertsink
    return sink(ui, path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/hgext/convert/subversion.py", line 1004, in __init__
    xport = transport.SvnRaTransport(url=geturl(path))
NameError: global name 'transport' is not defined

I searched you mailing list and I found the instruction to test the svn bindings in my local python installation. They work as you can see on the following output:

$ python -c 'import svn.core; print svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR'
1 6

As additional Information, here is the complete list of all the packages I've installed with MacPorts:

apr                            @1.3.12         devel/apr
apr                            @1.3.12         devel/apr
apr-util                       @1.3.9          devel/apr-util
bzip2                          @1.0.5          archivers/bzip2
cvs2svn                        @2.3.0          devel/cvs2svn
cyrus-sasl2                    @2.1.23         security/cyrus-sasl2
db46                           @4.6.21         databases/db46
expat                          @2.0.1          textproc/expat
fontconfig                     @2.8.0          graphics/fontconfig
freetype                       @2.3.12         print/freetype
gdbm                           @1.8.3          databases/gdbm
gettext                        @0.17           devel/gettext
gperf                          @3.0.4          devel/gperf
libiconv                       @1.13.1         textproc/libiconv
mercurial                      @1.4.2          devel/mercurial
ncurses                        @5.7            devel/ncurses
ncursesw                       @5.7            devel/ncursesw
neon                           @0.29.3         www/neon
openssl                        @0.9.8m         devel/openssl
openssl                        @0.9.8m         devel/openssl
pkgconfig                      @0.23           devel/pkgconfig
py26-hgsvn                     @0.1.7          python/py26-hgsvn
py26-setuptools                @0.6c11         python/py26-setuptools
py26-svn                       @1.7.0          python/py26-svn
python26                       @2.6.4          lang/python26
readline                       @6.1.000        devel/readline
serf                           @0.3.0          www/serf
sqlite3                        @3.6.22         databases/sqlite3
subversion                     @1.6.9          devel/subversion
tcl                            @8.5.8          lang/tcl
tk                             @8.5.8          x11/tk
Xft2                           @2.1.14         x11/Xft2
xorg-bigreqsproto              @1.1.0          x11/xorg-bigreqsproto
xorg-inputproto                @2.0            x11/xorg-inputproto
xorg-kbproto                   @1.0.4          x11/xorg-kbproto
xorg-libX11                    @1.3.3          x11/xorg-libX11
xorg-libXau                    @1.0.5          x11/xorg-libXau
xorg-libXdmcp                  @1.0.3          x11/xorg-libXdmcp
xorg-libXext                   @1.1.1          x11/xorg-libXext
xorg-libXScrnSaver             @1.2.0          x11/xorg-libXScrnSaver
xorg-renderproto               @0.11           x11/xorg-renderproto
xorg-scrnsaverproto            @1.2.0          x11/xorg-scrnsaverproto
xorg-util-macros               @1.6.0          x11/xorg-util-macros
xorg-xcmiscproto               @1.2.0          x11/xorg-xcmiscproto
xorg-xextproto                 @7.1.1          x11/xorg-xextproto
xorg-xf86bigfontproto          @1.2.0          x11/xorg-xf86bigfontproto
xorg-xproto                    @7.0.16         x11/xorg-xproto
xorg-xtrans                    @1.2.5          x11/xorg-xtrans
xrender                        @0.9.5          x11/xrender
zlib                           @1.2.3          archivers/zlib

Thanks and appreciation of your help!


Expanding on bolidor's question and answer:

If you're having trouble converting a repository from Subversion and Mercurial, and you use MacPorts, you'll probably want to:

  1. Install the subversion python bindings:

    sudo port install subversion-python26bindings
    
  2. Switch to MacPorts python:

    sudo port install python_select
    sudo python_select python26
    
  3. Do your conversion

  4. Switch back your python (optional)

    sudo python_select python26-apple
    


Ok. I got it.

I overlooked the comment of the python26 installation with Macports that this python version has still to be selected by installing and executing a script. The problem was that I still worked on the original Python on Snow Leopard. Therefore, I executed additionally to the python26 installation

sudo ports install python-select
sudo python_select python26

and tried the conversion again. The conversion then instantly worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜