chiark / gitweb /
git-debrebase: test: use conventional branch names
[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
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 : 'make branch names more conventional'
49 git branch -D master
50 git branch -m quilt-tip master
51
52 : 'see what gbp import-orig does'
53 git checkout master
54 gbp import-orig --upstream-version=2.0 ../$ust
55
56 not-gdr-processable
57
58 t-git-debrebase -fupstream-has-debian gbp2debrebase
59
60 : xxx
61 t-ok
62 exit 0
63
64
65 git checkout quilt-tip
66 git merge --no-edit --allow-unrelated-histories -Xtheirs --no-commit upstream
67 git checkout HEAD -- debian
68 git commit --no-edit
69
70
71
72 false
73
74 revision=1
75
76 push-to () {
77         t-refs-same-start
78         t-ref-head
79         t-dgit build
80         t-dgit push --new $2
81         t-pushed-good $1 $2
82         t-archive-process-incoming $2
83 }
84
85 echo ancestor >which
86 git add which
87 t-commit Ancestor '' stable
88 push-to master stable
89
90 git checkout -b stable
91
92 echo stable >which
93 git add which
94 t-commit Stable '' stable
95 push-to stable stable
96
97 git checkout master
98
99 majorv=2
100 revision=0
101
102 echo sid >which
103 git add which
104 t-commit Sid
105 push-to master sid
106
107 echo sid-again >>which
108 git add which
109 t-commit Sid
110 push-to master sid
111
112 t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"
113
114 t-ok