From 9d8a74791e9d359482a33ca1034af2b3211e32dd Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 8 Sep 2015 09:47:26 +0400 Subject: [PATCH 1/3] =?UTF-8?q?faire=20le=20push=20=C3=A0=20la=20fin=20des?= =?UTF-8?q?=20op=C3=A9rations=20d'update=20et/ou=20de=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prel | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/prel b/prel index 0adbd2f..645f995 100755 --- a/prel +++ b/prel @@ -84,7 +84,7 @@ OPTIONS -n, --no-write Si une nouvelle branche est créée avec -u, NE PAS mettre à jour le fichier VERSION.txt avec pver. Utiliser cette option si la mise à jour - du numéro de version doit être faite par manière particulière. + du numéro de version doit être faite d'une manière particulière. -e, --edit Editer le fichier CHANGES.txt autogénéré par -u -w Cette option est surtout utile si -m est utilisé avec -u, pour donner la @@ -173,6 +173,12 @@ fi git_ensure_gitvcs +push_branches=() +push_tags=() +push_deferred= +[ -n "$UTOOLS_VCS_OFFLINE" ] && push_deferred= || push_deferred=1 +[ -n "$update" -a -n "$merge" ] && UTOOLS_VCS_OFFLINE=1 + setx branch=git_get_branch if [ "$action" == update ]; then @@ -331,12 +337,14 @@ $modifs" git_fast_forward "$release" "" "$origin" fi + set -- "$release" if [ "$r" -eq 0 -a -n "$merge" ]; then # mettre à jour la branche sur laquelle on se trouve setx branch=git_get_branch - - set -- "$release" action=merge + elif [ "$r" -eq 0 ]; then + action=push + array_addu push_branches "$release" else exit "$r" fi @@ -391,11 +399,12 @@ if [ "$action" == merge ]; then if [ -n "$newver" ]; then estepn "Création du tag $newver" + array_addu push_tags "$newver" git tag --force "$newver" || die if git_have_remote "$origin"; then if [ -z "$UTOOLS_VCS_OFFLINE" ]; then git push "$origin" tag "$newver" - else + elif [ -z "$push_deferred" ]; then eimportant "Le tag $newver n'a pas été poussé vers l'origine. Il faudra le faire manuellement avec la commande suivante: $(qvals git push "$origin" tag "$newver") @@ -445,6 +454,24 @@ Veuillez le faire manuellement avec la commande suivante: $(qvals git push "$origin" ":$release")" fi fi + + action=push + array_addu push_branches master + array_addu push_branches develop +fi + +if [ "$action" == push -a -n "$push_deferred" ]; then + if git_have_remote "$origin"; then + estepi "Mise à jour de l'origine" + for tag in "${push_tags[@]}"; do + git push "$origin" tag "$tag" + done + for branch in "${push_branches[@]}"; do + setx rbranch=git_get_branch_rbranch "$branch" "$origin" + rbranch="${rbranch#refs/remotes/$origin/}" + git push "$origin" "$branch:$rbranch" + done + fi fi if [ "$action" == summary ]; then From 47b6e5b359e2eded6a5443de70f68ea25fd289ec Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 8 Sep 2015 10:14:13 +0400 Subject: [PATCH 2/3] =?UTF-8?q?cr=C3=A9er=20VERSION.txt=20et=20CHANGES.txt?= =?UTF-8?q?=20=C3=A0=20la=20racine=20du=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prel | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/prel b/prel index 645f995..e446a8d 100755 --- a/prel +++ b/prel @@ -278,6 +278,7 @@ if [ "$action" == checkout ]; then git_ensure_cleancheckout is_any_branch "$release" master release || die "$release: ce n'est pas une branche de release" r=0 + newbranch= if git_have_branch "$release"; then git checkout "$release"; r=$? elif git_have_rbranch "$release"; then @@ -288,6 +289,7 @@ Vous allez créer la nouvelle branche de release ${COULEUR_VERTE}$release${COULE à partir de la branche source ${COULEUR_BLEUE}$source${COULEUR_NORMALE}" ask_yesno "Voulez-vous continuer?" O || die + newbranch=1 git_ensure_branch "$release" "$source" "$origin" [ $? -eq 2 ] && die "Impossible de créer la branche $release. Veuillez vérifier que la branche $source existe" git checkout "$release"; r=$? @@ -298,6 +300,10 @@ Vous allez créer la nouvelle branche de release ${COULEUR_VERTE}$release${COULE fi if [ "$r" -eq 0 -a -n "$write" ]; then + set cwd=pwd + setx workdir=git rev-parse --show-toplevel + [ -d "$workdir" ] && cd "$workdir" + commitmsg="Init changelog" if [ -n "$newver" ]; then pver -uv "$newver" && commitmsg="Init changelog & version $newver" @@ -330,6 +336,8 @@ $modifs" git add -A git commit -m "$commitmsg" + + cd "$cwd" fi fi if [ "$r" -eq 0 ]; then @@ -342,7 +350,7 @@ $modifs" # mettre à jour la branche sur laquelle on se trouve setx branch=git_get_branch action=merge - elif [ "$r" -eq 0 ]; then + elif [ "$r" -eq 0 -a -n "$newbranch" ]; then action=push array_addu push_branches "$release" else From 79731619e4a5880f7a175d0a9ca5b1ff11923eb9 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 8 Sep 2015 10:14:59 +0400 Subject: [PATCH 3/3] Init changelog & version 2.15.0 --- CHANGES.txt | 6 ++++++ VERSION.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 067f1c7..71cb614 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,9 @@ +## Version 2.15.0 du 08/09/2015-10:14 + +69ee45a Intégration de la branche prel-fixes +47b6e5b créer VERSION.txt et CHANGES.txt à la racine du projet +9d8a747 faire le push à la fin des opérations d'update et/ou de merge + ## Version 2.14.0 du 03/09/2015-09:04 9dcd60b pxs transfert les données aussi en mode direct diff --git a/VERSION.txt b/VERSION.txt index edcfe40..68e69e4 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -2.14.0 +2.15.0