7 local gdr=${DGIT_GITDEBREBASE_TEST-git-debrebase}
9 {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{'
10 $gdr $GDR_TEST_OPTS $GDR_TEST_DEBUG $t_gdr_xopts "$@"
11 : '}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
17 local beforetag=$2 # say HEAD to skip this check
18 # state should be one of
23 git diff --quiet ${beforetag-t.before} -- ':.' ':!debian/patches'
25 local etype netype bwtip
30 bwtip=Y:`t-git-debrebase breakwater`
32 stitched) etype=Pseudomerge ;;
33 pushed) etype=AddPatches; netype=Pseudomerge ;;
36 t-git-debrebase analyse >../anal.check
37 expect=`git rev-parse HEAD`
39 local cid ctype info nparents
40 while read cid ctype info; do
41 : ===== $cid $ctype $info =====
44 if [ "x$ctype" = "x$etype" ]; then cetype=SAME; fi
45 local parents="`git log -n1 --pretty=format:%P $cid`"
48 : "$ctype/$cetype" "$parents"
50 case "$ctype/$cetype" in
53 Packaging/Upstream) ;;
55 Changelog/Packaging) ;;
56 Changelog/Upstream) ;;
58 BreakwaterUpstreamMerge/Upstream) ;;
59 BreakwaterUpstreamMerge/Packaging) ;;
61 fail "etype=$etype ctype=$ctype cetype=$cetype $cid"
65 case "$ctype/$etype" in
68 if [ "x$bwtip" != x ]; then
69 test "$bwtip" = "Y:$cid"
76 expect=${info#Contributor=}
79 git diff --quiet $expect..$cid
83 git diff --quiet $expect..$cid -- ':.' ':!debian'
84 git diff --quiet $expect..$cid -- ':debian/patches'
88 git diff --quiet $expect..$cid -- \
89 ':.' ':!debian/patches'
94 git diff --quiet $expect..$cid -- \
95 ':.' ':!debian/changelog'
99 git diff --quiet $expect..$cid -- ':debian'
101 BreakwaterUpstreamMerge)
106 local cnparents=`printf "%s" "$parents" | wc -w`
107 test $cnparents = $enparents
111 *) fail 'unexpected parent' ;;
122 echo >>debian/zorkmid "// debian $token"
123 git add debian/zorkmid
124 git commit -m "DEBIAN add zorkmid ($token)"
126 echo >>src.c "// upstream $token"
127 git commit -a -m "UPSTREAM edit src.c ($token)"
129 for f in debian/zorkmid src.c; do
130 echo "// both! $token" >>$f
133 git commit -m "MIXED add both ($token)"
138 t-make-new-upstream-tarball () {
140 git checkout make-upstream
141 # leaves ust set to filename of orig tarball
142 echo "upstream $uv" >>docs/README
143 git commit -a -m "upstream $uv tarball"
144 ust=example_$uv.orig.tar.gz
145 git archive -o ../$ust --prefix=example-2.0/ make-upstream
151 # nmu-upload-1 <nmubranch>
152 # gbp pq import or perhaps other similar things
154 # maybe make some dgit-covertible commits
159 git checkout -f -b $nmubranch
161 t-git-debrebase convert-to-gbp
163 # now we are on a gbp patched-unapplied branch
169 t-dch-commit -v $v -m "nmu $nmubranch $v"
175 t-dgit -wgf build-source
178 c=${p}_${v}_source.changes
179 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
180 dput -c $tmp/dput.cf test-dummy $c
182 t-archive-process-incoming sid
188 t-nmu-commit-an-upstream-change () {
189 echo >>newsrc.c "// more upstream"
191 git commit -m 'UPSTREAM NMU'
194 t-maintainer-commit-some-changes () {
195 t-dch-commit -v$v -m "start $v"
197 t-some-changes "maintainer $v"
199 t-git-debrebase stitch
201 git branch did.maintainer
206 t-nmu-causes-ff-fail () {
209 t-expect-fail E:'Not.*fast-forward' \
210 git merge --ff-only dgit/dgit/sid
212 t-expect-fail E:'-fdiverged.*refs/remotes/dgit/dgit/sid' \
216 t-nmu-reconciled-good () {
219 : 'check that what we have is what is expected'
221 git checkout -b compare.nmu origin/master~0
222 git checkout $nmutree .
223 git rm -rf debian/patches
224 git commit -m 'rm patches nmu'
226 git checkout -b compare.maintainer origin/master~0
227 git checkout did.maintainer .
228 git rm -rf --ignore-unmatch debian/patches
229 git commit --allow-empty -m 'rm patches maintainer'
231 git merge compare.nmu
232 git diff --quiet master
234 : 'check that dgit still likes it'
237 t-dgit -wgf quilt-fixup