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
82 : 'reject pointless pseudomerges'
83 local overwritten=${parents/$expect/}
84 overwritten=${overwritten// /}
85 t-git-debrebase analyse $overwritten >../anal.overwr
86 local ocid otype oinfo
87 read <../anal.overwr ocid otype oinfo
89 Pseudomerge) test "x$info" != "x$oinfo" ;;
93 git diff --quiet $expect..$cid -- ':.' ':!debian'
94 git diff --quiet $expect..$cid -- ':debian/patches'
98 git diff --quiet $expect..$cid -- \
99 ':.' ':!debian/patches'
104 git diff --quiet $expect..$cid -- \
105 ':.' ':!debian/changelog'
109 git diff --quiet $expect..$cid -- ':debian'
116 local cnparents=`printf "%s" "$parents" | wc -w`
117 test $cnparents = $enparents
120 for f in $parents; do echo $f; done | sort -u | wc -w
122 test $cndparents = $cnparents
126 *) fail 'unexpected parent' ;;
137 echo >>debian/zorkmid "// debian $token"
138 git add debian/zorkmid
139 git commit -m "DEBIAN add zorkmid ($token)"
141 echo >>src.c "// upstream $token"
142 git commit -a -m "UPSTREAM edit src.c ($token)"
144 for f in debian/zorkmid src.c; do
145 echo "// both! $token" >>$f
148 git commit -m "MIXED add both ($token)"
153 t-make-new-upstream-tarball () {
155 git checkout make-upstream
156 # leaves ust set to filename of orig tarball
157 echo "upstream $uv" >>docs/README
158 git commit -a -m "upstream $uv tarball"
159 ust=example_$uv.orig.tar.gz
160 git archive -o ../$ust --prefix=example-2.0/ make-upstream
166 # nmu-upload-1 <nmubranch>
167 # gbp pq import or perhaps other similar things
169 # maybe make some dgit-covertible commits
174 git checkout -f -b $nmubranch
176 t-git-debrebase convert-to-gbp
178 # now we are on a gbp patched-unapplied branch
184 t-dch-commit -v $v -m "nmu $nmubranch $v"
190 t-dgit -wgf build-source
193 c=${p}_${v}_source.changes
194 debsign -kBCD22CD83243B79D3DFAC33EA3DBCBC039B13D8A $c
195 dput -c $tmp/dput.cf test-dummy $c
197 t-archive-process-incoming sid
203 t-nmu-commit-an-upstream-change () {
204 echo >>newsrc.c "// more upstream"
206 git commit -m 'UPSTREAM NMU'
209 t-maintainer-commit-some-changes () {
210 t-dch-commit -v$v -m "start $v"
212 t-some-changes "maintainer $v"
214 t-git-debrebase stitch
216 git branch did.maintainer
221 t-nmu-causes-ff-fail () {
224 t-expect-fail E:'Not.*fast-forward' \
225 git merge --ff-only dgit/dgit/sid
227 t-expect-fail E:'-fdiverged.*refs/remotes/dgit/dgit/sid' \
231 t-nmu-reconciled-good () {
234 : 'check that what we have is what is expected'
236 git checkout -b compare.nmu origin/master~0
237 git checkout $nmutree .
238 git rm -rf debian/patches
239 git commit -m 'rm patches nmu'
241 git checkout -b compare.maintainer origin/master~0
242 git checkout did.maintainer .
243 git rm -rf --ignore-unmatch debian/patches
244 git commit --allow-empty -m 'rm patches maintainer'
246 git merge compare.nmu
247 git diff --quiet master
249 : 'check that dgit still likes it'
252 t-dgit -wgf quilt-fixup