--- oslo-series-final/0028-Added-guilt.reusebranch-configuration-option.patch +++ oslo-series-v2/v2-0028-Added-guilt.reusebranch-configuration-option.patch @@ -1,7 +1,7 @@ -From 3f163b252b9b4e2f81e56fcecf1d73f6c5c5f844 Mon Sep 17 00:00:00 2001 -From: Per Cederqvist -Date: Wed, 19 Mar 2014 21:55:02 +0100 -Subject: [GUILT 28/28] Added guilt.reusebranch configuration option. +From b06d1c8083d412ecc4bbbfdf8b7e8b1afa232893 Mon Sep 17 00:00:00 2001 +From: Per Cederqvist +Date: Tue, 13 May 2014 21:40:23 +0200 +Subject: [GUILT v2 28/29] Added guilt.reusebranch configuration option. To: Jeff Sipek Cc: git@vger.kernel.org @@ -16,11 +16,11 @@ Signed-off-by: Per Cederqvist --- - guilt | 29 +++- + guilt | 28 +++- regression/scaffold | 1 + regression/t-062.out | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++ - regression/t-062.sh | 140 ++++++++++++++++ - 4 files changed, 606 insertions(+), 5 deletions(-) + regression/t-062.sh | 137 ++++++++++++++++ + 4 files changed, 601 insertions(+), 6 deletions(-) create mode 100644 regression/t-062.out create mode 100755 regression/t-062.sh diff --git a/guilt b/guilt index 36cfd1e..c89d939 100755 --- a/guilt +++ b/guilt - @@ -925,13 +932,25 @@ else + @@ -928,13 +935,22 @@ else die "Unsupported operating system: $UNAME_S" fi -if [ "$branch" = "$raw_git_branch" ] && [ -n "`get_top 2>/dev/null`" ] - +if [ -n "`get_top 2>/dev/null`" ] - then + -then - # This is for compat with old repositories that still have a - # pushed patch without the new-style branch prefix. - old_style_prefix=true + +if [ -n "`get_top 2>/dev/null`" ]; then + # If there is at least one pushed patch, we set + # old_style_prefix according to how it was pushed. It is only + # possible to change the prefix style while no patches are + # applied. - + if [ "$branch" = "$raw_git_branch" ] - + then + + if [ "$branch" = "$raw_git_branch" ]; then + old_style_prefix=true + else + old_style_prefix=false + fi else - old_style_prefix=false - + if $reuse_branch - + then + + if $reuse_branch; then + old_style_prefix=true + else + old_style_prefix=false [...] fi _main "$@" diff --git a/regression/t-062.sh b/regression/t-062.sh new file mode 100755 index 0000000..e5d2e2d --- /dev/null +++ b/regression/t-062.sh - @@ -0,0 +1,140 @@ + @@ -0,0 +1,137 @@ +#!/bin/bash +# +# Test the branch-switching upgrade code [...] + +remove_topic() { + cmd guilt pop -a - + if git rev-parse --verify --quiet guilt/master >/dev/null - + then + + if git rev-parse --verify --quiet guilt/master >/dev/null; then + cmd git checkout guilt/master + else + cmd git checkout master [...] + +cmd list_files + - +for i in `seq 5` - +do - + if [ $i -ge 5 ] - + then + +for i in `seq 5`; do + + if [ $i -ge 5 ]; then + shouldfail guilt pop + else + cmd guilt pop [...] +cmd git branch +cmd guilt series --