chiark / gitweb /
git-debrebase: test suite: gbp2gdr: fix not-gdr-processable to not modify things
[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-git-debrebase analyse | grep 'Unknown Unprocessable'
12 }
13
14 p=example
15 t-worktree 1.1
16
17 cd example
18
19 : 'fake up some kind of upstream'
20 git checkout -b upstream quilt-tip
21 rm -rf debian
22 mkdir debian
23 echo junk >debian/rules
24 git add debian
25 git commit -m "an upstream retcon ($0)"
26
27 : 'fake up that our quilt-tip was descended from upstream'
28 git checkout quilt-tip
29 git merge --no-edit -s ours upstream
30
31 : 'fake up that our quilt-tip had the patch queue in it'
32 git checkout patch-queue/quilt-tip
33 gbp pq export
34 git add debian/patches
35 git commit -m "patch queue update ($0)"
36
37 not-gdr-processable
38
39 : 'fake up an upstream 2.0'
40 git checkout -b make-upstream upstream
41 echo upstream-v2 >>docs/README
42 git commit -a -m "an upstream v2 update"
43 ust=example_2.0.orig.tar.gz
44 git archive -o ../$ust --prefix=example-2.0/ make-upstream
45
46 : 'make branch names more conventional'
47 git branch -D master
48 git branch -m quilt-tip master
49
50 for b in \
51                 quilt-tip-2             \
52                 gitish-only             \
53                 quilt-tip-1.1           \
54                 patch-queue/quilt-tip   \
55                 indep-arch              \
56 ; do
57         git branch -D $b
58 done
59
60 : 'see what gbp import-orig does'
61 git checkout master
62 gbp import-orig --upstream-version=2.0 ../$ust
63
64 not-gdr-processable
65
66 dch -v 2.0-1 -m 'new upstream (did gbp import-orig)'
67 dch -r sid
68 git commit -m changelog debian/changelog
69
70 t-archive-none $p
71 t-git-none
72 t-dgit -wgf --gbp push-source --new
73
74 t-salsa-add-remote
75 git push --set-upstream origin master
76
77 # OK now this looks like something more normal.
78 # We have:
79 #  maintainer (gbp) view                dgit view
80 #    master
81 #    debian/2.0-1                          archive/debian/2.0-1
82 #    remotes/origin/master                 remotes/dgit/dgit/sid
83
84 t-git-debrebase -fupstream-has-debian gbp2debrebase
85
86 v=2.0-2
87 dch -v $v -m 'switch to git-debrebase, no other changes'
88 dch -r sid
89 git commit -m changelog debian/changelog
90
91 t-dgit -wgf push-source --new --overwrite
92 git push
93
94 cd ..
95
96 t-archive-process-incoming sid
97
98 t-setup-done '' "$(echo $p*) git mirror salsa aq" '
99         . $troot/lib-gdr
100         t-tstunt-parsechangelog
101         p=example
102 '
103
104 t-ok