Window batch file exits when executing mercury commands

To back up my mercury repositories daily on Windows XP, I used a simple batch file hg_backup.batthat just made some directory changes and calls to mercurial using the command pauseat the end, like this:

@Z:
@cd \hg_backup\drawings
hg pull -v
@cd \hg_backup\src\scripts
hg pull -v
@cd \hg_backup\eagle4\lbr
hg pull -v
@pause

This worked fine with mercury up to 1.7 (installed with TortoiseHg). However, starting with mercurial 1.8, it launches the very first mercury command, and then abruptly exits before reaching the following commands or even the end of the script. The command window just disappears.

I had the same problem a while ago when I tried the same with git but did not investigate further because I use git for only one repository. It seems to me that there is some return code for an incoming hg command line call that causes the script to terminate instead of executing another command, but I still could not verify this.

Does anyone have an idea why this is happening or maybe even how to fix it?

+5
source share
2 answers

If yours hgis hg.bator hg.cmd, use and see if it starts to work. call hg

command.com , script ( ), call script . Windows cmd.exe .

+8

, , @grawity, ( , ).

call cmd /C, :

cmd /C hg sum
cmd /C hg stat
0

All Articles