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) ;;
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'
106 local cnparents=`printf "%s" "$parents" | wc -w`
107 test $cnparents = $enparents
110 for f in $parents; do echo $f; done | sort -u | wc -w
112 test $cndparents = $cnparents
116 *) fail 'unexpected parent' ;;
127 echo >>debian/zorkmid "// debian $token"
128 git add debian/zorkmid
129 git commit -m "DEBIAN add zorkmid ($token)"
131 echo >>src.c "// upstream $token"
132 git commit -a -m "UPSTREAM edit src.c ($token)"
134 for f in debian/zorkmid src.c; do
135 echo "// both! $token" >>$f
138 git commit -m "MIXED add both ($token)"
143 t-make-new-upstream-tarball () {
145 git checkout make-upstream
146 # leaves ust set to filename of orig tarball
147 echo "upstream $uv" >>docs/README
148 git commit -a -m "upstream $uv tarball"
149 ust=example_$uv.orig.tar.gz
150 git archive -o ../$ust --prefix=example-2.0/ make-upstream
156 # nmu-upload-1 <nmubranch>
157 # gbp pq import or perhaps other similar things
159 # maybe make some dgit-covertible commits
164 git checkout -f -b $nmubranch
166 t-git-debrebase convert-to-gbp
168 # now we are on a gbp patched-unapplied branch
174 t-dch-commit -v $v -m "nmu $nmubranch $v"
180 t-dgit -wgf build-source
183 c=${p}_${v}_source.changes
184 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
185 dput -c $tmp/dput.cf test-dummy $c
187 t-archive-process-incoming sid
193 t-nmu-commit-an-upstream-change () {
194 echo >>newsrc.c "// more upstream"
196 git commit -m 'UPSTREAM NMU'
199 t-maintainer-commit-some-changes () {
200 t-dch-commit -v$v -m "start $v"
202 t-some-changes "maintainer $v"
204 t-git-debrebase stitch
206 git branch did.maintainer
211 t-nmu-causes-ff-fail () {
214 t-expect-fail E:'Not.*fast-forward' \
215 git merge --ff-only dgit/dgit/sid
217 t-expect-fail E:'-fdiverged.*refs/remotes/dgit/dgit/sid' \
221 t-nmu-reconciled-good () {
224 : 'check that what we have is what is expected'
226 git checkout -b compare.nmu origin/master~0
227 git checkout $nmutree .
228 git rm -rf debian/patches
229 git commit -m 'rm patches nmu'
231 git checkout -b compare.maintainer origin/master~0
232 git checkout did.maintainer .
233 git rm -rf --ignore-unmatch debian/patches
234 git commit --allow-empty -m 'rm patches maintainer'
236 git merge compare.nmu
237 git diff --quiet master
239 : 'check that dgit still likes it'
242 t-dgit -wgf quilt-fixup