문제

I am using Mercurial SCM over a LAN using a normal shared folder instead of HTTP and I'm having a problem getting the auto update hook to run.

I have entered this hook as detailed in the FAQ. This installs the hook, but when I push something to the remote repository, I get an error:

added 1 changesets with 1 changes to 1 files
running hook changegroup: hg update >&2
warning: changegroup hook exited with status -1

There is another stackoverflow question similar to this, but it offers no solutions other than it may be a permissions error somewhere.

Has anyone else had this problem and can anyone else shed any more light on this or give me a heads up on where to start fixing this? Thanks.

도움이 되었습니까?

해결책

Is hg in your standard search PATH ?

Replace your .hgrc configuration with a custom script, e.g.

[hooks]
changegroup = /var/tmp/myscript.sh

[ui]
debug = true

(unix) In the /var/tmp/myscript.sh write something like this:

#!/bin/sh
set -e
echo ---------- >>/tmp/myscript.log
set >>/tmp/myscript.log
echo --- >>/tmp/myscript.log
pwd >>/tmp/myscript.log
hg update >>/tmp/myscript.log 2>&1

(unix) Do not forget to mark as executable: chmod a+x /var/tmp/myscript.sh

(windows) The corresponding batch file myscript.bat is:

@echo off
echo ------ >>%TEMP%\myscript.log
set >>%TEMP%\myscript.log
echo --- >>%TEMP%\myscript.log
cd >>%TEMP%\myscript.log
hg update >>%TEMP%\myscript.log 2>&1

(windows) Of course, the line in .hgrc is changegroup = \your\directory\myscript.bat.

Run your hg push command to reproduce the problem.

Check the content of the /tmp/myscript.log file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top