summaryrefslogtreecommitdiff
path: root/tests/setup/gbp2gdr
blob: 5c2b969f9f85f5f6b53d54af475abfdca06406df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
set -e
. tests/lib
. $troot/lib-gdr

t-dependencies git-buildpackage libfile-fnmatch-perl

t-tstunt-parsechangelog

not-gdr-processable () {
	t-expect-fail F:'Cannot cope with this commit' \
	t-git-debrebase
}

p=example
t-worktree 1.1

cd example

: 'fake up some kind of upstream'
git checkout -b upstream quilt-tip
rm -rf debian
mkdir debian
echo junk >debian/rules
git add debian
git commit -m "an upstream retcon ($0)"

: 'fake up that our quilt-tip was descended from upstream'
git checkout quilt-tip
git merge --no-edit -s ours upstream

: 'fake up that our quilt-tip had the patch queue in it'
git checkout patch-queue/quilt-tip
gbp pq export
git add debian/patches
git commit -m "patch queue update ($0)"

not-gdr-processable

: 'fake up an upstream 2.0'
git checkout -b make-upstream upstream
echo upstream-v2 >>docs/README
git commit -a -m "an upstream v2 update"
ust=example_2.0.orig.tar.gz
git archive -o ../$ust --prefix=example-2.0/ make-upstream

: 'make branch names more conventional'
git branch -D master
git branch -m quilt-tip master

: 'see what gbp import-orig does'
git checkout master
gbp import-orig --upstream-version=2.0 ../$ust

not-gdr-processable

dch -v 2.0-1 -m 'new upstream (did gbp import-orig)'
dch -r sid
git commit -m changelog debian/changelog

t-archive-none $p
t-git-none
t-dgit -wgf --gbp push-source --new

t-salsa-add-remote
git push --set-upstream origin master

# OK now this looks like something more normal.
# We have:
#  maintainer (gbp) view                dgit view
#    master
#    debian/2.0-1                          archive/debian/2.0-1
#    remotes/origin/master                 remotes/dgit/dgit/sid

t-git-debrebase -fupstream-has-debian gbp2debrebase

dch -v 2.0-2 -m 'switch to git-debrebase, no other changes'
dch -r sid
git commit -m changelog debian/changelog

t-dgit -wgf push-source --new --overwrite
git push

t-ok
exit 0


git checkout quilt-tip
git merge --no-edit --allow-unrelated-histories -Xtheirs --no-commit upstream
git checkout HEAD -- debian
git commit --no-edit



false

revision=1

push-to () {
	t-refs-same-start
	t-ref-head
	t-dgit build
	t-dgit push --new $2
	t-pushed-good $1 $2
	t-archive-process-incoming $2
}

echo ancestor >which
git add which
t-commit Ancestor '' stable
push-to master stable

git checkout -b stable

echo stable >which
git add which
t-commit Stable '' stable
push-to stable stable

git checkout master

majorv=2
revision=0

echo sid >which
git add which
t-commit Sid
push-to master sid

echo sid-again >>which
git add which
t-commit Sid
push-to master sid

t-setup-done 'p v suitespecs majorv revision' "aq git mirror $p"

t-ok