chiark / gitweb /
5c2b969f9f85f5f6b53d54af475abfdca06406df
[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 t-ok
85 exit 0
86
87
88 git checkout quilt-tip
89 git merge --no-edit --allow-unrelated-histories -Xtheirs --no-commit upstream
90 git checkout HEAD -- debian
91 git commit --no-edit
92
93
94
95 false
96
97 revision=1
98
99 push-to () {
100         t-refs-same-start
101         t-ref-head
102         t-dgit build
103         t-dgit push --new $2
104         t-pushed-good $1 $2
105         t-archive-process-incoming $2
106 }
107
108 echo ancestor >which
109 git add which
110 t-commit Ancestor '' stable
111 push-to master stable
112
113 git checkout -b stable
114
115 echo stable >which
116 git add which
117 t-commit Stable '' stable
118 push-to stable stable
119
120 git checkout master
121
122 majorv=2
123 revision=0
124
125 echo sid >which
126 git add which
127 t-commit Sid
128 push-to master sid
129
130 echo sid-again >>which
131 git add which
132 t-commit Sid
133 push-to master sid
134
135 t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"
136
137 t-ok