diff options
author | René Neumann <rene.neumann@in.tum.de> | 2012-02-23 19:02:25 +0100 |
---|---|---|
committer | René Neumann <rene.neumann@in.tum.de> | 2012-02-23 19:02:26 +0100 |
commit | 1c7cc1c8293a2243d9f41a03f2401e793bf1a4f2 (patch) | |
tree | 96ad0bcbd212f5db1fc15063d5a18d79aa58e8aa | |
parent | c538380ef3915c9c1adc036fc8d2292331898fc9 (diff) | |
download | dotfiles-1c7cc1c8293a2243d9f41a03f2401e793bf1a4f2.tar.gz dotfiles-1c7cc1c8293a2243d9f41a03f2401e793bf1a4f2.tar.bz2 dotfiles-1c7cc1c8293a2243d9f41a03f2401e793bf1a4f2.zip |
Port cci to new stgit version
Diffstat (limited to '')
-rw-r--r-- | .zsh/functions/cci | 18 | ||||
-rw-r--r-- | .zsh/zshrc | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/.zsh/functions/cci b/.zsh/functions/cci index 4baaa7d..6d10917 100644 --- a/.zsh/functions/cci +++ b/.zsh/functions/cci @@ -13,6 +13,11 @@ _ask_$0 () fi } +_stg_v_$0 () +{ + python -c 'from stgit.builtin_version import version; print version' +} + if [[ $# == 0 ]]; then echo "No message given. Aborting." return 1 @@ -55,7 +60,14 @@ if [[ -z $(cstg files) ]]; then fi echo ">> Committing" -cstg commit $tok +cstg commit $tok || return + +# from 0.16 onwards stg repushes the patches ... pop them again +# this is needed to make the `config push` work +if is-at-least 0.16 $(_stg_v_$0); then + echo ">>> Popping patches, stg thought it had to re-apply" + cstg pop -a -k || return +fi if [[ -n $(cstg series --applied) ]]; then echo @@ -65,10 +77,10 @@ if [[ -n $(cstg series --applied) ]]; then fi echo ">> Pushing to remote" -config push +config push || return echo ">> Re-apply patches" -cstg push -a -k +cstg push -a -k || return echo ">> Done" @@ -1,3 +1,6 @@ +# provide the is-at-least command +autoload is-at-least + # Alias definition {{{ ################################################# @@ -137,7 +140,7 @@ RPROMPT="%(?.%S%{$fg[green]%}:).%S%{$fg[red]%}:()%{$reset_color%}%s" # vcs stuff for prompt setopt prompt_subst -if [[ $ZSH_VERSION == 4.3.<->* ]]; then +if is-at-least 4.3; then autoload -Uz vcs_info zstyle ":vcs_info:*" enable bzr cvs svn git hg |