I have a few different darcs repos and I would like to write a script to automatically push changes from these repos at the end of the day. I read at this thread that the "right" way to script darcs is using the library. But here http://darcs.net/Library it says that "it is very much a work in progress" and lacks a stable API. What is the "right" way to script darcs.
It's perfectly fine to script everyday darcs commands, like any other command-line program. It's also fine to script interactive darcs commands, but that's where it gets fragile, because those interactive prompts get refined and changed quite often in new darcs releases. So if at all possible, make the command non-interactive, eg using the -a/--all flag. Push and pull is easy, here's a regular pull that I run from /etc/crontab:
*/15 * * * * darcsden cd /home/darcsden/darcs/darcs-reviewed; darcs pull -a http://darcs.net/reviewed >/dev/null # 2>&1
but watch out for things that can prevent a successful non-interactive push or pull:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With