帮助我处理 Mercurial 扩展导出文件
我正在尝试使用 Mercurial 的 exportfiles 扩展名,但出现此错误:
c:\xampp\htdocs\dev>hg exportfiles -r 1 /tmp/export
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
** Mercurial Distributed SCM (version 1.9+10-e9264b45237d)
** Extensions loaded: exportfiles
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 27, in run
File "mercurial\dispatch.pyo", line 64, in dispatch
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 675, in _dispatch
File "mercurial\dispatch.pyo", line 454, in runcommand
File "mercurial\dispatch.pyo", line 729, in _runcommand
File "mercurial\dispatch.pyo", line 683, in checkargs
File "mercurial\dispatch.pyo", line 672, in <lambda>
File "mercurial\util.pyo", line 385, in check
File "C:\Users\Sasa/exportfiles.py", line 39, in exportfiles
rng = cmdutil.revrange(repo, opts['rev'])
AttributeError: 'module' object has no attribute 'revrange'
我正在使用TortiseHG 2.1.1 for Windows 32-bit with Mercurial 1.9+10
你能帮我解决这个问题并使用exportfiles扩展吗?
提前致谢!
i'm trying to use exportfiles extension for mercurial but I'm getting this error:
c:\xampp\htdocs\dev>hg exportfiles -r 1 /tmp/export
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
** Mercurial Distributed SCM (version 1.9+10-e9264b45237d)
** Extensions loaded: exportfiles
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 27, in run
File "mercurial\dispatch.pyo", line 64, in dispatch
File "mercurial\dispatch.pyo", line 87, in _runcatch
File "mercurial\dispatch.pyo", line 675, in _dispatch
File "mercurial\dispatch.pyo", line 454, in runcommand
File "mercurial\dispatch.pyo", line 729, in _runcommand
File "mercurial\dispatch.pyo", line 683, in checkargs
File "mercurial\dispatch.pyo", line 672, in <lambda>
File "mercurial\util.pyo", line 385, in check
File "C:\Users\Sasa/exportfiles.py", line 39, in exportfiles
rng = cmdutil.revrange(repo, opts['rev'])
AttributeError: 'module' object has no attribute 'revrange'
I'm using TortiseHG 2.1.1 for Windows 32-bit with Mercurial 1.9+10
Could you help me please to solve this and use exportfiles extension?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Mercurial 的 API 在版本 1.8 后发生了更改。
假设这个是您正在使用的扩展的源,第 11 行应该是
,第 39 行应该是
Mercurial's API changed after version 1.8.
Assuming this is the source of the extension you're using, line 11 should be
and line 39 should be
Mercurial 的内部结构可能发生了一些变化,并且扩展需要更新,但我并不完全认为出了问题。
注意:我看到cmdutil
似乎有一个revrange
方法。cmdutil
源代码的地方> 显然是一个过时的分支。但是,在有人加入修复扩展之前,有一个解决方法至少可以获取添加或修改的文件列表。您可以转换输出或将其提供给您自己的脚本,以便复制正确的文件:
这列出了从修订版 100 到修订版 110 添加或修改的文件(您不能使用
-r
作为--rev
的缩短开关,它是--removed
的缩写)。输出在每个相对路径之前都有一个M
或A
。It's possible that Mercurial's internals have changed a bit and the extension needs to be updated, however I'm not entirely what's wrong.
NB: The place where I saw the source forcmdutil
does seem to have arevrange
method.cmdutil
was evidently an out-of-date fork.However, until someone chimes in with a fix to the extension, there is a workaround for at least getting a list of files added or modified. You can transform the output or feed it to your own script in order to get the right files copied:
This lists files added or modified from revision 100 to revision 110 (you can't use
-r
as a shortened switch of--rev
, it's short for--removed
). The output has aM
orA
before each relative path.