début d'implémentation de ptools

This commit is contained in:
Jephté Clain 2015-02-19 16:25:06 +04:00 committed by Jephte CLAIN
parent 0e5bf817a2
commit 359563b423
4 changed files with 55 additions and 3 deletions

38
lib/ulib/ptools Normal file
View File

@ -0,0 +1,38 @@
##@cooked comments # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
## Fonctions pour la gestion des projets
##@cooked nocomments
##@include vcs
##@include semver
uprovide ptools
urequire vcs semver
function __get_branch() {
local branch="$1"
[ -n "$branch" ] || branch="$(git_get_branch)"
echo "$branch"
}
function is_master_branch() {
local branch; branch="$(__get_branch "$1")" || return 2
[ "$branch" == "master" ]
}
function is_develop_branch() {
local branch; branch="$(__get_branch "$1")" || return 2
[ "$branch" == "develop" ]
}
function is_release_branch() {
local branch; branch="$(__get_branch "$1")" || return 2
[[ "$branch" == release-* ]]
}
function is_hotfix_branch() {
local branch; branch="$(__get_branch "$1")" || return 2
[[ "$branch" == hotfix-* ]]
}
function is_topic_branch() {
local branch; branch="$(__get_branch "$1")" || return 2
[ "$branch" == "master" ] && return 1
[ "$branch" == "develop" ] && return 1
[[ "$branch" == release-* ]] && return 1
[[ "$branch" == hotfix-* ]] && return 1
return 0
}

16
pdev
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
urequire DEFAULTS ptools
function display_help() {
uecho "$scriptname: basculer sur une branche de développement
@ -37,3 +37,17 @@ OPTIONS
parse_opts "${PRETTYOPTS[@]}" \
--help '$exit_with display_help' \
@ args -- "$@" && set -- "${args[@]}" || die "$args"
topic="$1"
source="$2"
setx -a branches=git_list_branches
if [ -n "$topic" ]; then
# Créer/basculer vers une branche de topic
:
else
# Créer/basculer vers la branche de développement
:
fi

2
pfix
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
urequire DEFAULTS ptools
function display_help() {
uecho "$scriptname: basculer sur une branche de hotfix

2
prel
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
urequire DEFAULTS
urequire DEFAULTS ptools
# XXX ajouter la possibilité de faire des pré-releases, --alpha, --beta, --rc
# les pré-releases restent dans la branche de release, et vivent leur vie,