有没有办法在颠覆提交中自动恢复?
我在提交时经常遇到事务错误。据我所知,这些是由于提交中途失败造成的。有没有一种方法,最好使用像 TortoiseSVN 这样的 GUI,可以自动恢复失败的提交,并不断重试,直到所有内容都提交?
提交失败的示例:
提交失败(详细信息如下): 放置的 '/svn/namcloud/!svn/wrk/02b0f9ff-2510-a147-892a-2ee0b7b442dc/src/sites/all/modules/globalredirect/LICENSE.txt': 无法读取响应正文:现有连接被强制关闭 远程主机。 (http://XXX.XXX.XXX)
I ofen get transaction errors when committing. These, as far as I know, are as result of commits that fail halfway through. Is there a way, preferably using a GUI such as TortoiseSVN, that will automatically resume a commit where it failed and will keep retrying until everything is commit?
Example of a failed commit:
Commit failed (details follow):
PUT of
'/svn/namcloud/!svn/wrk/02b0f9ff-2510-a147-892a-2ee0b7b442dc/src/sites/all/modules/globalredirect/LICENSE.txt':
Could not read response body: An existing connection was forcibly closed by the
remote host.
(http://XXX.XXX.XXX)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
它不是完全自动的,但有一个
TortoiseSVN
->设置...
->对话框 2
->提交失败后重新打开提交和分支/标记对话框
复选框。这会减少一点烦恼,自动恢复您的日志消息。“现有连接被远程主机强制关闭”可能表示
RST
沿着 TCP/IP 连接返回。这可以由您和远程主机之间的任何内容生成。我建议使用 Wireshark 之类的东西,看看是否有任何明显的东西。 (如果您不习惯的话,这种诊断会很棘手,但仍然值得快速查看一下。)
正如 AH 所建议的,您可能需要与服务器管理员联系。连接超时的一些证据可能会出现在其网络服务器或防火墙日志中,或者在 SSL 配置指令等中可能存在立即明显的超时设置。
It is not entirely automatic, but there is a
TortoiseSVN
->Settings...
->Dialogs 2
->Reopen commit and branch/tag dialog after a commit failed
checkbox. This cuts down on the annoyance a bit, automatically resurrecting your log message."An existing connection was forcibly closed by the remote host" probably indicates an
RST
coming back along the TCP/IP connection. This can be generated by anything between you and the remote host.I'd recommend grabbing something like Wireshark and seeing if there's anything immediately obvious. (This kind of diagnosis is tricky if you're not used to it, but worth a quick look all the same.)
As A.H. suggested, you may want to get in touch with the server administrator. It is possible some evidence of a connection timeout may show up in their webserver or firewall logs, or there may be an immediately obvious timeout setting in e.g. a SSL configuration directive.
不幸的是,我们并不总是可以选择我们使用什么,或者我们在服务器端拥有什么样的支持/管理。
一种“更邪恶”的方法是创建一个脚本,一遍又一遍地单独提交树中的每个文件,直到全部成功。
当然,在一次大型提交中,有人可能会抱怨有 100 多条几乎相同的日志消息,每个文件一条,就像大型 RCS/CVS 提交一样,人们会“更新”并在开始时“之间”获取一些内容提交和完成,然后你可以告诉他们你遇到的问题,以及你被迫诉诸的“解决方案”,以便完成工作,尽管管理和支持不善。
不幸的是,对于特别大的文件,或者特别“糟糕”的网络问题,这可能仍然不起作用。
最坏的情况是,项目中的其他人也向你乞求剧本。
或者我猜有人可能会因此“解雇”你。但这可能会比在这样的环境中工作更好的结果,这种环境会破坏你为实现目标所做的一切努力,然后当你试图克服他们的障碍来完成任务时让你“承担责任”。
Unfortunately, we do not always have the choice of what we use, or what kind of support/management we have on the server side of things.
One 'more evil' way to go about it would be to create a script that commits every file in the tree individually, over and over again, until they all succeed.
Of course, on a large commit, someone might complain that there are 100+ nearly identical log messages, one for each file, and just like a big RCS/CVS commit, people will 'update' and get something 'between' the start of the commit and the finish, but then you can tell them about the problems you have, and the 'solution' you were forced to resort to, in order to GET WORK DONE, despite poor management and support.
Unfortunately, for particularly big files, or particularly 'bad' network problems, this still might not work.
Worst case, everyone else on the project begs you for the script, too.
Or I guess someone could 'fire' you over it. But that would probably be a better outcome than working in the sort of environment that sabotages your every effort to accomplish goals, then holds you 'accountable' when you try to overcome their obstacles to get things done.
SVN 中的“事务”或“原子提交”就是这样——全有或全无。因此没有自动恢复。恢复。您所能做的就是从头开始办理登机手续。
更好的解决方案是与相应的服务器管理员联系以调查并修复原因。只治标不治本绝不是一个好主意。
A "transaction" or "atomic commit" in SVN is exactly that - all or nothing. Therefore there is no auto_resume. All you could do is to start the checkin from the very beginning.
The better solution is talking to the appropriate server admin to investigate and fix the cause. Curing the symptoms only is never a good idea.
我认为此功能已被删除。我在 TortoiseSVN 1.7.11 Build 23600 中没有看到这个选项
I think this feature has been removed. I don't see this option in TortoiseSVN 1.7.11 Build 23600
问题是某些网络提供商会在短暂超时后断开连接。向中国的酒店(或加拿大的罗杰斯)投诉,他们不会解决这个问题。不幸的是,当提交中断时,所有已上传的文件都会丢失。所以永远不可能完成提交。
The problem is that some network providers break the connection after a short time-out. Complain all you want to a hotel in China (or to Rogers in Canada), they are not going to fix that. Unfortunately when the commit is interrupted, all the already uploaded files are lost. So it's never possible to complete the commit.