接收“MERGE”使用 trac-post-commit-hook 提交时出现 200 OK 错误

发布于 2024-08-03 04:05:01 字数 256 浏览 8 评论 0原文

使用 trac-post-commit-hook 运行提交时,我收到 MERGE 200 OK 错误,我知道这意味着提交已在服务器上成功,但文件状态在我的本地计算机上尚未更新。但无论如何我找不到解决这个问题的办法。这是我的设置问题还是脚本中的问题。我正在使用来自 trac 站点的库存标准脚本,我通过 tortoiseSVN 提交到托管在 Windows 2008 服务器上的 VisualSVN 服务器。当我通过命令行运行脚本时,我没有收到任何错误,我仅通过 TortoiseSVN 收到此错误。

When running a commit with the trac-post-commit-hook I receive a MERGE 200 OK error, I understand that this means that the commit has succeeded on the server but the file status has not updated on my local machine. But I can't find anyway to fix this issue. Would this be a problem with my setup or something in the script. I'm using stock standard script from the trac site, I'm committing through tortoiseSVN to VisualSVN Server which is hosted on a windows 2008 server. When I run the script through a command line I receive no errors, I only receive this error through TortoiseSVN.

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

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

发布评论

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

评论(3

嗫嚅 2024-08-10 04:05:01

您的 Trac post-commit 挂钩问题听起来像这样:

http://ariejan.net/2007/05/21/merge-request-failed-on-pathtofile/

Your problem with the Trac post-commit hook sounds like this:

http://ariejan.net/2007/05/21/merge-request-failed-on-pathtofile/

泪意 2024-08-10 04:05:01

我遇到过与 Trac 无关的钩子问题。在提交后,我调用了一些其他脚本,这些脚本在存储库中更改了 svnlook 和 cat ,并且出现了 MERGE 200 OK 错误。解决方案是在后台调用另一个脚本,以便钩子在启动脚本后立即退出。

I've had this problems for hooks that had nothing to do with Trac. From post-commit I called some other script that did svnlook changed and cat in the repository, and I got MERGE 200 OK error. The solution was to call the other script in the background so that the hook exits immediately after starting the script.

醉酒的小男人 2024-08-10 04:05:01

我使用 Trac & 收到此错误Debian“Lenny”下的颠覆。

对我来说,这归结为 Trac 中的一个错误。在 trac.util.datefmt 中:

def to_timestamp(dt):
"""Return the corresponding POSIX timestamp"""
if dt:
    diff = dt - _epoc
    return diff.days * 86400 + diff.seconds
else:
    return 0

其中 dt 是时间戳。因此,首先转换为日期时间:

def to_timestamp(dt):
"""Return the corresponding POSIX timestamp"""
if dt:
    dtt = to_datetime(dt)
    diff = dtt - _epoc
    return diff.days * 86400 + diff.seconds
else:
    return 0

现在我们必须解决 trac-post-commit-hook 脚本中的问题,因为 trac.env.Environment 的 'href' 和 'abs_href' 属性是仅获取属性(没有setter):

--- trac/trac-post-commit-hook  (revision 8)
+++ trac/trac-post-commit-hook  (working copy)
@@ -152,11 +152,7 @@
         self.author = chgset.author
         self.rev = rev
         self.msg = "(In [%s]) %s" % (rev, chgset.message)
         self.now = int(time.time()) 
-        if url is None:
-            url = self.env.config.get('trac', 'base_url')
-        self.env.href = Href(url)
-        self.env.abs_href = Href(url)

这一切都在 Debian“Lenny”,trac 0.11.1-2.1 上

I got this error using Trac & Subversion under Debian "Lenny".

For me it boiled down to a bug in Trac. In trac.util.datefmt:

def to_timestamp(dt):
"""Return the corresponding POSIX timestamp"""
if dt:
    diff = dt - _epoc
    return diff.days * 86400 + diff.seconds
else:
    return 0

Where dt is a timestamp. So convert to a datetime first:

def to_timestamp(dt):
"""Return the corresponding POSIX timestamp"""
if dt:
    dtt = to_datetime(dt)
    diff = dtt - _epoc
    return diff.days * 86400 + diff.seconds
else:
    return 0

Now we have to fix a problem in the trac-post-commit-hook script, since the 'href' and 'abs_href' attributes of trac.env.Environment are get-only properties (there is no setter):

--- trac/trac-post-commit-hook  (revision 8)
+++ trac/trac-post-commit-hook  (working copy)
@@ -152,11 +152,7 @@
         self.author = chgset.author
         self.rev = rev
         self.msg = "(In [%s]) %s" % (rev, chgset.message)
         self.now = int(time.time()) 
-        if url is None:
-            url = self.env.config.get('trac', 'base_url')
-        self.env.href = Href(url)
-        self.env.abs_href = Href(url)

This is all on Debian "Lenny", trac 0.11.1-2.1

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