chiark / gitweb /
2dbb51548af5f928efd2d9e08ff79695494ae7e4
[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 t-dch-commit -v 2.0-1 -m 'new upstream (did gbp import-orig)'
67 t-dch-commit -r sid
68
69 t-archive-none $p
70 t-git-none
71 t-dgit -wgf --gbp push-source --new
72
73 t-salsa-add-remote
74 git push --set-upstream origin master
75
76 # OK now this looks like something more normal.
77 # We have:
78 #  maintainer (gbp) view                dgit view
79 #    master
80 #    debian/2.0-1                          archive/debian/2.0-1
81 #    remotes/origin/master                 remotes/dgit/dgit/sid
82
83 t-git-debrebase -fupstream-has-debian gbp2debrebase
84
85 v=2.0-2
86 dch -v $v -m 'switch to git-debrebase, no other changes'
87 dch -r sid
88 git commit -m changelog debian/changelog
89
90 t-dgit -wgf push-source --new --overwrite
91 git push
92
93 cd ..
94
95 t-archive-process-incoming sid
96
97 t-setup-done '' "$(echo $p*) git mirror salsa aq" '
98         . $troot/lib-gdr
99         t-tstunt-parsechangelog
100         p=example
101 '
102
103 t-ok