chiark / gitweb /
c4714e345159a3848b4ba24ca1b718bfa47ab3d3
[dgit.git] / tests / setup / gbp2gdr
1 #!/bin/bash
2 set -e
3 . tests/lib
4 . $troot/lib-gdr
5
6 t-dependencies git-buildpackage
7
8 t-tstunt-parsechangelog
9
10
11 not-gdr-processable () {
12         t-expect-fail F:'Cannot cope with this commit' \
13         t-git-debrebase
14 }
15
16 p=example
17 t-worktree 1.1
18
19 cd example
20
21 : 'fake up some kind of upstream'
22 git checkout -b upstream quilt-tip
23 rm -rf debian
24 mkdir debian
25 echo junk >debian/rules
26 git add debian
27 git commit -m "an upstream retcon ($0)"
28
29 : 'fake up that our quilt-tip was descended from upstream'
30 git checkout quilt-tip
31 git merge --no-edit -s ours upstream
32
33 : 'fake up that our quilt-tip had the patch queue in it'
34 git checkout patch-queue/quilt-tip
35 gbp pq export
36 git add debian/patches
37 git commit -m "patch queue update ($0)"
38
39 not-gdr-processable
40
41 : 'fake up an upstream 2.0'
42 git checkout -b make-upstream upstream
43 echo upstream-v2 >>docs/README
44 git commit -a -m "an upstream v2 update"
45 ust=example_2.0.orig.tar.gz
46 git archive -o ../$ust --prefix=example-2.0/ make-upstream
47
48 : 'see what gbp import-orig does'
49 git checkout quilt-tip
50 gbp import-orig --debian-branch=quilt-tip --upstream-version=2.0 ../$ust
51
52 not-gdr-processable
53
54 : xxx
55 t-ok
56 exit 0
57
58
59 git checkout quilt-tip
60 git merge --no-edit --allow-unrelated-histories -Xtheirs --no-commit upstream
61 git checkout HEAD -- debian
62 git commit --no-edit
63
64
65
66 false
67
68 revision=1
69
70 push-to () {
71         t-refs-same-start
72         t-ref-head
73         t-dgit build
74         t-dgit push --new $2
75         t-pushed-good $1 $2
76         t-archive-process-incoming $2
77 }
78
79 echo ancestor >which
80 git add which
81 t-commit Ancestor '' stable
82 push-to master stable
83
84 git checkout -b stable
85
86 echo stable >which
87 git add which
88 t-commit Stable '' stable
89 push-to stable stable
90
91 git checkout master
92
93 majorv=2
94 revision=0
95
96 echo sid >which
97 git add which
98 t-commit Sid
99 push-to master sid
100
101 echo sid-again >>which
102 git add which
103 t-commit Sid
104 push-to master sid
105
106 t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"
107
108 t-ok