Ceci est une ancienne révision du document !
Problème:
Comment tester facilement si des changements sont en attente (status, outgoing, incoming) dans plusieurs projets ?
Script:
#!/bin/bash # script to test if changes are pending in some Mercurial repositories # author: Nicolas Rod, 13.08.2010 workspace=/home/rodn/workspace/ repositories="cakephp_alaxos blaxos demo_alaxos tandem" unchanged_text="aucun changement" #clear the screen for better display clear for repository in $repositories do echo "----------------------" echo "|| $repository ||" echo "----------------------" cd "$workspace$repository" echo "---------status" st=$(hg status) st_length=${#st} if (($st_length > 0)) then echo -e "\033[1;32m$st\033[0m" fi echo "---------incoming" in=$(hg incoming) if ! grep -q "$unchanged_text" <<<$in; then echo -e "\033[1;32m$in\033[0m" fi echo "---------outgoing" out=$(hg outgoing) if ! grep -q "$unchanged_text" <<<$out; then echo -e "\033[1;32m$out\033[0m" fi echo done