在 Mac 上使用有效的 python 绑定将 SVN 转换为 Mercurial 不起作用

发布于 2024-08-24 04:57:41 字数 6612 浏览 1 评论 0原文

我尝试将本地 SCN 存储库(及其所有历史记录)转换为 Mercurial。我正在 Mac (10.6.2) 上工作。因此,我使用 Macports 作为包管理工具。

我开始转换:

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

结果是,它开始工作正常,但过了一会儿,它就停止了。这就是输出:

initializing svn wc 'calebsvn-wc'
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or [email protected]
** 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

我搜索了您的邮件列表,并找到了在本地 python 安装中测试 svn 绑定的指令。它们的工作方式如您在以下输出中看到的那样:

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

作为附加信息,这里是我使用 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

感谢并感谢您的帮助!

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 [email protected]
** 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌上青苔 2024-08-31 04:57:41

扩展 Bolidor 的问题和答案:

如果您在从 Subversion 和 Mercurial 转换存储库时遇到问题,并且您使用 MacPorts,您可能需要:

  1. 安装 subversion python 绑定:

    sudo port install subversion-python26bindings
    
  2. 切换到 MacPorts python:

    sudo port install python_select
    sudo python_select python26
    
  3. 进行转换

  4. 切换回 python(可选)

    sudo python_select python26-apple
    

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
    
简美 2024-08-31 04:57:41

好的。我得到了它。

我忽略了 Macports 上的 python26 安装的注释,即该 python 版本仍需通过安装和执行脚本来选择。问题是我仍然在 Snow Leopard 上使用原始的 Python。因此,我额外执行了 python26 安装

sudo ports install python-select
sudo python_select python26

并再次尝试转换。
转换立即生效。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文