I have multiple mercurial repositories and used hg clone
to create backups of them on our file server. Now I want to write a batch file that updates them once a day by running hg pull -u
on each subdirectory.
I want to keep this backup script as generic as possible, so it should update all backup repositories stored in my H:\BACKUPS\REPOS folder. This is my hgbackup.bat that is stored in the same folder:
for /f "delims=" %%i in ('dir /ad/b') do hg pull -u
The problem: hg pull only seems to operate on the current working directory, there seems to be no switch to specify the target repository for the pull. As I hate Windows Batch Scripting, I want to keep my .bat as simple as possible and avoid cd'ing to the different directories.
Any ideas how I can run hg pull -u
on a different directory?