chiark / gitweb /
git-debrebase: Provide and test "conclude"
[dgit.git] / tests / lib-gdr
index de365a2465e2a115553939f0d5b43f433eaa3c13..c80dead656ade953a80a2c8ef836a50c15a3bc09 100644 (file)
@@ -18,7 +18,7 @@ t-gdr-good () {
        # state should be one of
        #   laundered
        #   stitched
-       #   patches
+       #   pushed
 
        git diff --quiet ${beforetag-t.before} -- ':.' ':!debian/patches'
 
@@ -55,8 +55,8 @@ t-gdr-good () {
                Changelog/Packaging)                    ;;
                Changelog/Upstream)                     ;;
                Upstream/SAME)                          ;;
-               BreakwaterUpstreamMerge/Upstream)       ;;
-               BreakwaterUpstreamMerge/Packaging)      ;;
+               Anchor/Upstream)                        ;;
+               Anchor/Packaging)                       ;;
                *)
                        fail "etype=$etype ctype=$ctype cetype=$cetype $cid"
                        ;;
@@ -78,6 +78,16 @@ t-gdr-good () {
                        enparents=2
                        git diff --quiet $expect..$cid
                        etype=Upstream
+
+                       : 'reject pointless pseudomerges'
+                       local overwritten=${parents/$expect/}
+                       overwritten=${overwritten// /}
+                       t-git-debrebase analyse $overwritten >../anal.overwr
+                       local ocid otype oinfo
+                       read <../anal.overwr ocid otype oinfo
+                       case "$otype" in
+                       Pseudomerge) test "x$info" != "x$oinfo" ;;
+                       esac
                        ;;
                Packaging)
                        git diff --quiet $expect..$cid -- ':.' ':!debian' 
@@ -98,7 +108,7 @@ t-gdr-good () {
                Upstream/SAME)
                        git diff --quiet $expect..$cid -- ':debian'
                        ;;
-               BreakwaterUpstreamMerge)
+               Anchor)
                        break
                        ;;
                esac
@@ -106,6 +116,11 @@ t-gdr-good () {
                local cnparents=`printf "%s" "$parents" | wc -w`
                test $cnparents = $enparents
 
+               local cndparents=`
+       for f in $parents; do echo $f; done | sort -u | wc -w
+                               `
+               test $cndparents = $cnparents
+
                case "$parents" in
                *"$expect"*)    ;;
                *)              fail 'unexpected parent' ;;