Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
tips_informatiques:hg:tips_informatiques [2010/08/13 09:59] nico créée |
tips_informatiques:hg:tips_informatiques [2015/10/30 13:14] (Version actuelle) nico |
||
|---|---|---|---|
| Ligne 14: | Ligne 14: | ||
| workspace=/home/rodn/workspace/ | workspace=/home/rodn/workspace/ | ||
| repositories="cakephp_alaxos blaxos demo_alaxos tandem" | repositories="cakephp_alaxos blaxos demo_alaxos tandem" | ||
| + | unchanged_text="aucun changement" | ||
| #clear the screen for better display | #clear the screen for better display | ||
| Ligne 36: | Ligne 37: | ||
| echo "---------incoming" | echo "---------incoming" | ||
| in=$(hg incoming) | in=$(hg incoming) | ||
| - | if ! grep -q "aucun changement" <<<$in; | + | if ! grep -q "$unchanged_text" <<<$in; |
| then | then | ||
| echo -e "\033[1;32m$in\033[0m" | echo -e "\033[1;32m$in\033[0m" | ||
| Ligne 43: | Ligne 44: | ||
| echo "---------outgoing" | echo "---------outgoing" | ||
| out=$(hg outgoing) | out=$(hg outgoing) | ||
| - | if ! grep -q "aucun changement" <<<$out; | + | if ! grep -q "$unchanged_text" <<<$out; |
| then | then | ||
| echo -e "\033[1;32m$out\033[0m" | echo -e "\033[1;32m$out\033[0m" | ||
| Ligne 50: | Ligne 51: | ||
| echo | echo | ||
| done | done | ||
| + | </code> | ||
| + | |||
| + | |||
| + | ====== Appliquer un commit à un autre projet (patch) ====== | ||
| + | |||
| + | __Problème__: | ||
| + | |||
| + | Dans le cas de deux projets distincts A et B ayant un même projet comme ancêtre, il est possible d'appliquer des commits du projet A au projet B, pour par exemple corriger un bug existant dans les deux projets A et B | ||
| + | |||
| + | __Commandes__: | ||
| + | |||
| + | |||
| + | 1) procéder au commit dans le projet A | ||
| + | |||
| + | 2) exporter le changeset du commit: | ||
| + | |||
| + | <code bash> | ||
| + | hg export -o changeset-54.patch 54:e3745da77977 | ||
| + | </code> | ||
| + | |||
| + | 3) dans le projet B, importer le changeset: | ||
| + | |||
| + | <code bash> | ||
| + | hg import changeset-54.patch --no-commit | ||
| + | </code> | ||
| + | |||
| + | Note: l'ajout de --no-commit permet de vérifier les changements appliqués avant de les commiter dans le projet B | ||
| + | |||
| + | |||
| + | |||
| + | ====== Logs au format CSV ====== | ||
| + | |||
| + | __Problème__: | ||
| + | |||
| + | Comment obtenir les logs d'un projet dans un format que l'on peut parser facilement | ||
| + | |||
| + | |||
| + | __Commandes__: | ||
| + | |||
| + | <code bash> | ||
| + | $ hg log --template "{rev}\t{node}\t{date|isodate}\t{author}\t{desc}\n" | ||
| + | |||
| + | 61 6aab1393fc3dd13c429121a92979a4a9fc797f70 2012-07-13 18:17 +0200 Nicolas Rod <nico@alaxos.com> ACL plugin update | ||
| + | 60 806ca0813e7b5fe3685452386195c9fbc6f5f065 2012-07-13 18:13 +0200 Nicolas Rod <nico@alaxos.com> Alaxos plugin update | ||
| + | 59 edb937096cddb2ee947e1dd15cef727e3798db71 2012-07-02 13:04 +0200 Nicolas Rod <nico@alaxos.com> Alaxos plugin update | ||
| + | |||
| </code> | </code> | ||