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 diff --git a/prel b/prel index 0adbd2f..e446a8d 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 @@ -272,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 @@ -282,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=$? @@ -292,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" @@ -324,6 +336,8 @@ $modifs" git add -A git commit -m "$commitmsg" + + cd "$cwd" fi fi if [ "$r" -eq 0 ]; then @@ -331,12 +345,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 -a -n "$newbranch" ]; then + action=push + array_addu push_branches "$release" else exit "$r" fi @@ -391,11 +407,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 +462,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