簡體   English   中英

使用后提交掛鈎時SVN提交合並錯誤

[英]SVN Commit Merge Error when using post-commit hook

我一直在閱讀人們使用提交后掛鈎提出的其他一些類似問題。 但是還沒有找到一個與我的問題足夠接近的問題,它可以提供答案:(.。我有一個可以檢出的SVN信息庫,當我提交時,我試圖對其進行掛鈎,以便它會自動更新Webroot。夾。

目前,我的提交后腳本如下所示:

#!/bin/sh

#REPOS="$1"
#REV="$2"

cd /var/www/thecruisein.com_dev/ && /usr/bin/svn update --username anon --password anon

具有以下權限:

-rwxr--r--. 1 apache apache 122 Jan 28 10:00 post-commit

但是,當我嘗試通過NetBeans將更改提交到文件時,出現以下錯誤:

org.apache.subversion.javahl.ClientException: E175002: Commit failed (details follow):
E175002: Processing MERGE request response failed: Element type "http:" must be followed by either attribute specifications, ">" or "/>". (/subversion/thecruisein_dev) 
E175002: MERGE request failed on '/subversion/thecruisein_dev'

我暫時禁用了SELinux(行為沒有改變:(),/ usr / bin / svn文件的權限為:

-rwxr-xr-x. 1 apache apache 181500 Apr 11  2013 /usr/bin/svn

當我完全刪除提交后腳本時,事情將按預期運行(當然,webroot不會更新)。 因此,啟用此提交后腳本的Subversion似乎是一個問題。

任何幫助將不勝感激,因為我不確定下一步該怎么去:(

原來,我需要在提交后的掛鈎中執行一個已編譯的程序。

我的編譯程序是“ autoupdate”,它具有以下內容:

#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>

int main(void) {
  execl("/usr/bin/svn", "svn", "update", "/var/www/thecruisein.com_dev/", "--username", "anon", "--password", "anon",
    (const char *) NULL);
  return(EXIT_FAILURE);
}

我的提交后腳本如下所示:

#!/bin/sh

REPOS="$1"
REV="$2"

/var/svn/thecruisein_dev-autoupdate &>/dev/null

(&> / dev / null ---重定向任何輸出以防止干擾)

編譯后的C程序的文件權限如下:

-rwsr-sr-x   1 apache apache 4813 Jan 28 11:40 thecruisein_dev-autoupdate

這解決了問題,並允許進行提交並自動顯示在預期的webroot文件夾中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM