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'
27 LC_MESSAGES=C t-git-debrebase status >../status.check
30 egrep '^ *branch is laundered' ../status.check
34 '^ *branch contains furniture|^ *branch is unlaundered|^ *branch needs laundering' ../status.check
35 egrep '^ stitched$' ../status.check
39 # etypes is either a type,
40 # or PseudoMerge-<more etypes>
41 # or AddPatches-<more etypes>
46 bwtip=Y:`t-git-debrebase breakwater`
48 stitched) etypes=Pseudomerge-Upstream ;;
49 pushed) etypes=AddPatches-Pseudomerge-Upstream ;;
52 t-git-debrebase analyse >../anal.check
53 expect=`git rev-parse HEAD`
55 local cid ctype info nparents
56 while read cid ctype info; do
57 : ===== $cid $ctype $info =====
59 local cetype=${etypes%%-*}
60 if [ "x$ctype" = "x$cetype" ]; then cetype=SAME; fi
61 local parents="`git log -n1 --pretty=format:%P $cid`"
64 : "$ctype/$cetype" "$parents"
66 case "$ctype/$cetype" in
69 Packaging/Upstream) ;;
71 Changelog/Packaging) ;;
72 Changelog/Upstream) ;;
77 fail "etypes=$etypes ctype=$ctype cetype=$cetype $cid"
81 case "$ctype/$etypes" in
84 if [ "x$bwtip" != x ]; then
85 test "$bwtip" = "Y:$cid"
92 expect=${info#Contributor=}
95 git diff --quiet $expect..$cid
98 : 'reject pointless pseudomerges'
99 local overwritten=${parents/$expect/}
100 overwritten=${overwritten// /}
101 t-git-debrebase analyse $overwritten >../anal.overwr
102 local ocid otype oinfo
103 read <../anal.overwr ocid otype oinfo
105 Pseudomerge) test "x$info" != "x$oinfo" ;;
109 git diff --quiet $expect..$cid -- ':.' ':!debian'
110 git diff --quiet $expect..$cid -- ':debian/patches'
114 git diff --quiet $expect..$cid -- \
115 ':.' ':!debian/patches'
119 git diff --quiet $expect..$cid -- \
120 ':.' ':!debian/changelog'
124 git diff --quiet $expect..$cid -- ':debian'
131 local cnparents=`printf "%s" "$parents" | wc -w`
132 test $cnparents = $enparents
135 for f in $parents; do echo $f; done | sort -u | wc -w
137 test $cndparents = $cnparents
141 *) fail 'unexpected parent' ;;
152 echo >>debian/zorkmid "// debian $token"
153 git add debian/zorkmid
154 git commit -m "DEBIAN add zorkmid ($token)"
156 echo >>src.c "// upstream $token"
157 git commit -a -m "UPSTREAM edit src.c ($token)"
159 for f in debian/zorkmid src.c; do
160 echo "// both! $token" >>$f
163 git commit -m "MIXED add both ($token)"
168 t-make-new-upstream-tarball () {
170 git checkout make-upstream
171 # leaves ust set to filename of orig tarball
172 echo "upstream $uv" >>docs/README
173 git commit -a -m "upstream $uv tarball"
174 ust=example_$uv.orig.tar.gz
175 git archive -o ../$ust --prefix=example-2.0/ make-upstream
181 # nmu-upload-1 <nmubranch>
182 # gbp pq import or perhaps other similar things
184 # maybe make some dgit-covertible commits
189 git checkout -f -b $nmubranch
191 t-git-debrebase convert-to-gbp
193 # now we are on a gbp patched-unapplied branch
199 t-dch-commit -v $v -m "nmu $nmubranch $v"
205 t-dgit -wgf build-source
208 c=${p}_${v}_source.changes
209 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
210 dput -c $tmp/dput.cf test-dummy $c
212 t-archive-process-incoming sid
218 t-nmu-commit-an-upstream-change () {
219 echo >>newsrc.c "// more upstream"
221 git commit -m 'UPSTREAM NMU'
224 t-maintainer-commit-some-changes () {
225 t-dch-commit -v$v -m "start $v"
227 t-some-changes "maintainer $v"
229 t-git-debrebase stitch
231 git branch did.maintainer
236 t-nmu-causes-ff-fail () {
239 t-expect-fail E:'Not.*fast-forward' \
240 git merge --ff-only dgit/dgit/sid
242 t-expect-fail E:'-fdiverged.*refs/remotes/dgit/dgit/sid' \
246 t-nmu-reconciled-good () {
249 : 'check that what we have is what is expected'
251 git checkout -b compare.nmu origin/master~0
252 git checkout $nmutree .
253 git rm -rf debian/patches
254 git commit -m 'rm patches nmu'
256 git checkout -b compare.maintainer origin/master~0
257 git checkout did.maintainer .
258 git rm -rf --ignore-unmatch debian/patches
259 git commit --allow-empty -m 'rm patches maintainer'
261 git merge compare.nmu
262 git diff --quiet master
264 : 'check that dgit still likes it'
267 t-dgit -wgf quilt-fixup