chiark / gitweb /
d64b867c66653482c1ae030df1a3ecbe0f0e1019
[dgit.git] / tests / setup / gdr-convert-gbp
1 #!/bin/bash
2 set -e
3 autoimport=
4 . tests/lib
5 . $troot/lib-gdr
6
7 $ifarchive t-setup-import gnupg
8
9 t-dependencies GDR
10
11 t-tstunt-parsechangelog
12
13 not-gdr-processable () {
14         t-git-debrebase analyse | grep 'Unknown Unprocessable'
15 }
16
17 p=example
18 t-worktree 1.1
19
20 cd example
21
22 : 'fake up some kind of upstream'
23 git checkout -b upstream quilt-tip
24 rm -rf debian
25 mkdir debian
26 echo junk >debian/rules
27 git add debian
28 git commit -m "an upstream retcon ($0)"
29
30 : 'fake up that our quilt-tip was descended from upstream'
31 git checkout quilt-tip
32 git merge --no-edit -s ours upstream
33
34 : 'fake up that our quilt-tip had the patch queue in it'
35 git checkout patch-queue/quilt-tip
36 gbp pq export
37 git add debian/patches
38 git commit -m "patch queue update ($0)"
39
40 not-gdr-processable
41
42 : 'fake up an upstream 2.0'
43 git branch make-upstream upstream
44 t-make-new-upstream-tarball 2.0
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
68
69 $ifarchive t-archive-none $p
70 $ifarchive t-git-none
71 $ifarchive 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 convert-from-gbp
84
85 v=2.0-2
86 t-dch-commit -v $v -m 'switch to git-debrebase, no other changes'
87 t-dch-commit-r
88
89 $ifarchive t-dgit -wgf push-source --new
90 git push
91
92 cd ..
93
94 $ifarchive t-archive-process-incoming sid
95
96 t-setup-done '' "$(echo $p*) salsa $($ifarchive echo git mirror aq)" '
97         . $troot/lib-gdr
98         t-tstunt-parsechangelog
99         p=example
100         t-git-next-date
101 '
102
103 t-ok