如何使用 hgsvn pull 跳过 subversion 修订?

发布于 2024-10-22 04:36:28 字数 5305 浏览 9 评论 0原文

我正在尝试使用 Mercurial 作为 Subversion 的前端,并且对保持所有分支等完整无缺非常感兴趣,这样我就可以看到常见的更改等。

但是,我的所有 subversion 存储库都为 Mercurial 带来了相当大的问题(1.8 与 TortoiseHg 2.0 不幸的是,ppa 似乎删除了旧版本...)。这些问题多种多样,而且令​​人烦恼,无法列出(或弄清楚)。

如何跳过 hg clonehg pull 抱怨的 svn 修订版?或者我是否只需要递归地获得越来越少的修订,直到获得成功的克隆?

另外,我尝试通过从 svn 导出补丁并将其应用到我的工作目录来解决这个问题;发生完全相同的问题(但至少现在我有一些东西要看...)

我遇到的问题(但不是专门针对该问题的主题...)

现有文件覆盖尝试:

通过hg init实现,设置svn url和hg pull

pulling from svn+http://subversion/src/...
[r5061] StephenK: Updated properties
/home/stephenk/hgsubversion/hgsubversion/wrappers.py:337: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  ui.status('%s\n' % e.message)
This Subversion server is older than 1.4.0, and cannot satisfy replay requests.
In light of that, I'll fall back and do diffs, but it won't do as good a job. You should really upgrade your server.
[r5061] StephenK: Updated properties
file Synchronisation/stephenk.properties already exists
1 out of 1 hunks FAILED -- saving rejects to file Synchronisation/stephenk.properties.rej

一般 Hunk 问题:

通过 hg clone 实现

[r82] Louis: 
patching file src/main/.../Configuration.java
Hunk #1 FAILED at 10
Hunk #2 FAILED at 27
Hunk #3 FAILED at 81
3 out of 3 hunks FAILED -- saving rejects to file src/main/.../Configuration.java.rej

常见错误文本:

** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3]
** Mercurial Distributed SCM (version 1.8)
** Extensions loaded: hgsubversion
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 36, in dispatch
    return _runcatch(u, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 58, in _runcatch
    return _dispatch(ui, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 601, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 406, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 655, in _runcommand
    return checkargs()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 609, in checkargs
    return cmdfunc()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 598, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 133, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 457, in clone
    orig(ui, source, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/commands.py", line 825, in clone
    branch=opts.get('branch'))
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 178, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 448, in hgclonewrapper
    data['srcrepo'], data['dstrepo'] = orig(ui, origsource, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/hg.py", line 335, in clone
    dest_repo.clone(src_repo, heads=revs, stream=stream)
  File "/usr/lib/pymodules/python2.6/mercurial/localrepo.py", line 2014, in clone
    return self.pull(remote, heads)
  File "/home/stephenk/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
    return fn(self, *args, **opts)
  File "/home/stephenk/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
    return wrappers.pull(self, remote, heads, force)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 325, in pull
    firstrun)
  File "/home/stephenk/hgsubversion/hgsubversion/stupid.py", line 592, in convert_rev
    ui, svn, meta, b, branches[b], r, parentctx)
  File "/home/stephenk/hgsubversion/hgsubversion/stupid.py", line 159, in diff_branchrev
    {}, strip=0)
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1108, in applydiff
    eolmode=eolmode)
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1135, in _applydiff
    rejects += closefile()
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1122, in closefile
    current_file.write_rej()
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 519, in write_rej
    fp = self.opener(fname, 'w')
TypeError: 'NoneType' object is not callable

我在 ubuntu 上,真的希望有一个 ppa 来为我管理它,并且对这种互操作性感到沮丧。我想我可能必须尝试 hg+git+svn 双桥或其他东西

I'm trying to use Mercurial as a front end for Subversion, and have a strong interest in having all branches etc intact so I can see common changes etc.

However, all of my subversion repositories create rather large issues for mercurial (1.8 with TortoiseHg 2.0 unfortunately, the ppa's seem to have deleted the older revisions...). The issues are varied and present far too much annoyance to list (or figure out).

How do I skip a svn revision that hg clone or hg pull complains about? Or do I just have to recursively get fewer and fewer revisions until I get a successful clone?

Also, I've tried working around this by exporting the patch from svn and applying it to my working directory; the exact same issue occurs (but at least now I've got something to look at...)

Issues I'm getting (but not specifically on topic for the question...)

Existing file overwrite attempt:

Achieved by hg init, set svn url and hg pull

pulling from svn+http://subversion/src/...
[r5061] StephenK: Updated properties
/home/stephenk/hgsubversion/hgsubversion/wrappers.py:337: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  ui.status('%s\n' % e.message)
This Subversion server is older than 1.4.0, and cannot satisfy replay requests.
In light of that, I'll fall back and do diffs, but it won't do as good a job. You should really upgrade your server.
[r5061] StephenK: Updated properties
file Synchronisation/stephenk.properties already exists
1 out of 1 hunks FAILED -- saving rejects to file Synchronisation/stephenk.properties.rej

General Hunk issues:

Achieved by hg clone

[r82] Louis: 
patching file src/main/.../Configuration.java
Hunk #1 FAILED at 10
Hunk #2 FAILED at 27
Hunk #3 FAILED at 81
3 out of 3 hunks FAILED -- saving rejects to file src/main/.../Configuration.java.rej

Common error text:

** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3]
** Mercurial Distributed SCM (version 1.8)
** Extensions loaded: hgsubversion
Traceback (most recent call last):
  File "/usr/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 36, in dispatch
    return _runcatch(u, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 58, in _runcatch
    return _dispatch(ui, args)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 601, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 406, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 655, in _runcommand
    return checkargs()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 609, in checkargs
    return cmdfunc()
  File "/usr/lib/pymodules/python2.6/mercurial/dispatch.py", line 598, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 133, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 457, in clone
    orig(ui, source, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/util.py", line 433, in check
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/mercurial/commands.py", line 825, in clone
    branch=opts.get('branch'))
  File "/usr/lib/pymodules/python2.6/mercurial/extensions.py", line 178, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 448, in hgclonewrapper
    data['srcrepo'], data['dstrepo'] = orig(ui, origsource, dest, **opts)
  File "/usr/lib/pymodules/python2.6/mercurial/hg.py", line 335, in clone
    dest_repo.clone(src_repo, heads=revs, stream=stream)
  File "/usr/lib/pymodules/python2.6/mercurial/localrepo.py", line 2014, in clone
    return self.pull(remote, heads)
  File "/home/stephenk/hgsubversion/hgsubversion/svnrepo.py", line 48, in wrapper
    return fn(self, *args, **opts)
  File "/home/stephenk/hgsubversion/hgsubversion/svnrepo.py", line 63, in pull
    return wrappers.pull(self, remote, heads, force)
  File "/home/stephenk/hgsubversion/hgsubversion/wrappers.py", line 325, in pull
    firstrun)
  File "/home/stephenk/hgsubversion/hgsubversion/stupid.py", line 592, in convert_rev
    ui, svn, meta, b, branches[b], r, parentctx)
  File "/home/stephenk/hgsubversion/hgsubversion/stupid.py", line 159, in diff_branchrev
    {}, strip=0)
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1108, in applydiff
    eolmode=eolmode)
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1135, in _applydiff
    rejects += closefile()
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 1122, in closefile
    current_file.write_rej()
  File "/usr/lib/pymodules/python2.6/mercurial/patch.py", line 519, in write_rej
    fp = self.opener(fname, 'w')
TypeError: 'NoneType' object is not callable

I'm on ubuntu, really want to have a ppa to manage it for me, and am getting frustrated with this interoperability. I'm thinking I may have to try a hg+git+svn double bridge or something

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

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

发布评论

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

评论(2

扎心 2024-10-29 04:36:28

考虑将服务器升级到 1.4.x 或更高版本 - 事情应该会更好...

看起来(从堆栈跟踪)你在 diff+patch 代码中发现了一些错误,我们用来解决缺乏在旧的 svn 版本中重播,但是如果没有我们可以使用的测试存储库,就不可能知道问题出在哪里。

Consider upgrading the server to 1.4.x or later - things should work way way better then...

It looks (from the stack traces) like you've found some bugs in the diff+patch code we use to work around a lack of replay in old svn versions, but it's impossible to know what the problem is without a test repo we can play with.

听,心雨的声音 2024-10-29 04:36:28

...今天它起作用了...也许我同时从 svn 执行两个 hg pull 操作?我很确定一个人会失败,但这是我现在能继续下去的最好结果......

...and today it works... Perhaps I was doing two hg pull operations from svn at once? I'm pretty sure one will fail, but it's the best I can go on for now...

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