chiark / gitweb /
test suite: gbp2gdr: call t-setup-done
[dgit.git] / tests / setup / gbp2gdr
1 #!/bin/bash
2 set -e
3 . tests/lib
4 . $troot/lib-gdr
5
6 t-dependencies git-buildpackage libfile-fnmatch-perl
7
8 t-tstunt-parsechangelog
9
10 not-gdr-processable () {
11         t-expect-fail F:'Cannot cope with this commit' \
12         t-git-debrebase
13 }
14
15 p=example
16 t-worktree 1.1
17
18 cd example
19
20 : 'fake up some kind of upstream'
21 git checkout -b upstream quilt-tip
22 rm -rf debian
23 mkdir debian
24 echo junk >debian/rules
25 git add debian
26 git commit -m "an upstream retcon ($0)"
27
28 : 'fake up that our quilt-tip was descended from upstream'
29 git checkout quilt-tip
30 git merge --no-edit -s ours upstream
31
32 : 'fake up that our quilt-tip had the patch queue in it'
33 git checkout patch-queue/quilt-tip
34 gbp pq export
35 git add debian/patches
36 git commit -m "patch queue update ($0)"
37
38 not-gdr-processable
39
40 : 'fake up an upstream 2.0'
41 git checkout -b make-upstream upstream
42 echo upstream-v2 >>docs/README
43 git commit -a -m "an upstream v2 update"
44 ust=example_2.0.orig.tar.gz
45 git archive -o ../$ust --prefix=example-2.0/ make-upstream
46
47 : 'make branch names more conventional'
48 git branch -D master
49 git branch -m quilt-tip master
50
51 : 'see what gbp import-orig does'
52 git checkout master
53 gbp import-orig --upstream-version=2.0 ../$ust
54
55 not-gdr-processable
56
57 dch -v 2.0-1 -m 'new upstream (did gbp import-orig)'
58 dch -r sid
59 git commit -m changelog debian/changelog
60
61 t-archive-none $p
62 t-git-none
63 t-dgit -wgf --gbp push-source --new
64
65 t-salsa-add-remote
66 git push --set-upstream origin master
67
68 # OK now this looks like something more normal.
69 # We have:
70 #  maintainer (gbp) view                dgit view
71 #    master
72 #    debian/2.0-1                          archive/debian/2.0-1
73 #    remotes/origin/master                 remotes/dgit/dgit/sid
74
75 t-git-debrebase -fupstream-has-debian gbp2debrebase
76
77 dch -v 2.0-2 -m 'switch to git-debrebase, no other changes'
78 dch -r sid
79 git commit -m changelog debian/changelog
80
81 t-dgit -wgf push-source --new --overwrite
82 git push
83
84 cd ..
85 t-setup-done '' "$(echo $p*) git mirror salsa aq" '
86         . $troot/lib-gdr
87         t-tstunt-parsechangelog
88         p=example
89 '
90
91 t-ok