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 ;;
50 pushed-interop) etypes=Pseudomerge-AddPatchesInterop-Upstream ;;
53 t-git-debrebase analyse >../anal.check
54 expect=`git rev-parse HEAD`
56 local cid ctype info nparents
57 while read cid ctype info; do
58 : ===== $cid $ctype $info =====
60 local cetype=${etypes%%-*}
61 if [ "x$ctype" = "x$cetype" ]; then cetype=SAME; fi
62 local parents="`git log -n1 --pretty=format:%P $cid`"
65 : "$ctype/$cetype" "$parents"
67 case "$ctype/$cetype" in
70 Packaging/Upstream) ;;
72 AddPatches/AddPatchesInterop) ;;
73 Changelog/Packaging) ;;
74 Changelog/Upstream) ;;
79 fail "etypes=$etypes ctype=$ctype cetype=$cetype $cid"
83 case "$ctype/$etypes" in
86 if [ "x$bwtip" != x ]; then
87 test "$bwtip" = "Y:$cid"
94 git log -n1 --pretty=format:%B \
95 | grep '^\[git-debrebase[ :]'
101 expect=${info#Contributor=}
104 git diff --quiet $expect..$cid
107 : 'reject pointless pseudomerges'
108 local overwritten=${parents/$expect/}
109 overwritten=${overwritten// /}
110 t-git-debrebase analyse $overwritten >../anal.overwr
111 local ocid otype oinfo
112 read <../anal.overwr ocid otype oinfo
114 Pseudomerge) test "x$info" != "x$oinfo" ;;
118 git diff --quiet $expect..$cid -- ':.' ':!debian'
119 git diff --quiet $expect..$cid -- ':debian/patches'
123 git diff --quiet $expect..$cid -- \
124 ':.' ':!debian/patches'
128 git diff --quiet $expect..$cid -- \
129 ':.' ':!debian/changelog'
133 git diff --quiet $expect..$cid -- ':debian'
140 local cnparents=`printf "%s" "$parents" | wc -w`
141 test $cnparents = $enparents
144 for f in $parents; do echo $f; done | sort -u | wc -w
146 test $cndparents = $cnparents
150 *) fail 'unexpected parent' ;;
161 echo >>debian/zorkmid "// debian $token"
162 git add debian/zorkmid
163 git commit -m "DEBIAN add zorkmid ($token)"
165 echo >>src.c "// upstream $token"
166 git commit -a -m "UPSTREAM edit src.c ($token)"
168 for f in debian/zorkmid src.c; do
169 echo "// both! $token" >>$f
172 git commit -m "MIXED add both ($token)"
177 t-make-new-upstream-tarball () {
179 git checkout make-upstream
180 # leaves ust set to filename of orig tarball
181 echo "upstream $uv" >>docs/README
182 git commit -a -m "upstream $uv tarball"
183 ust=example_$uv.orig.tar.gz
184 git archive -o ../$ust --prefix=example-2.0/ make-upstream
190 # nmu-upload-1 <nmubranch>
191 # gbp pq import or perhaps other similar things
193 # maybe make some dgit-covertible commits
198 git checkout -f -b $nmubranch
200 t-git-debrebase convert-to-gbp
202 # now we are on a gbp patched-unapplied branch
208 t-dch-commit -v $v -m "nmu $nmubranch $v"
214 t-dgit -wgf build-source
217 c=${p}_${v}_source.changes
218 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
219 dput -c $tmp/dput.cf test-dummy $c
221 t-archive-process-incoming sid
227 t-nmu-commit-an-upstream-change () {
228 echo >>newsrc.c "// more upstream"
230 git commit -m 'UPSTREAM NMU'
233 t-maintainer-commit-some-changes () {
234 t-dch-commit -v$v -m "start $v"
236 t-some-changes "maintainer $v"
238 t-git-debrebase stitch
240 git branch did.maintainer
245 t-nmu-causes-ff-fail () {
248 t-expect-fail E:'Not.*fast-forward' \
249 git merge --ff-only dgit/dgit/sid
251 t-expect-fail E:'-fdiverged.*refs/remotes/dgit/dgit/sid' \
255 t-nmu-reconciled-good () {
258 : 'check that what we have is what is expected'
260 git checkout -b compare.nmu origin/master~0
261 git checkout $nmutree .
262 git rm -rf debian/patches
263 git commit -m 'rm patches nmu'
265 git checkout -b compare.maintainer origin/master~0
266 git checkout did.maintainer .
267 git rm -rf --ignore-unmatch debian/patches
268 git commit --allow-empty -m 'rm patches maintainer'
270 git merge compare.nmu
271 git diff --quiet master
273 : 'check that dgit still likes it'
276 t-dgit -wgf quilt-fixup