chiark / gitweb /
git-debrebase: rename gbp2gdr to convert-from-gbp
[dgit.git] / tests / setup / gdr-convert-gbp
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-git-debrebase analyse | grep 'Unknown Unprocessable'
12 }
13
14 p=example
15 t-worktree 1.1
16
17 cd example
18
19 : 'fake up some kind of upstream'
20 git checkout -b upstream quilt-tip
21 rm -rf debian
22 mkdir debian
23 echo junk >debian/rules
24 git add debian
25 git commit -m "an upstream retcon ($0)"
26
27 : 'fake up that our quilt-tip was descended from upstream'
28 git checkout quilt-tip
29 git merge --no-edit -s ours upstream
30
31 : 'fake up that our quilt-tip had the patch queue in it'
32 git checkout patch-queue/quilt-tip
33 gbp pq export
34 git add debian/patches
35 git commit -m "patch queue update ($0)"
36
37 not-gdr-processable
38
39 : 'fake up an upstream 2.0'
40 git branch make-upstream upstream
41 t-make-new-upstream-tarball 2.0
42
43 : 'make branch names more conventional'
44 git branch -D master
45 git branch -m quilt-tip master
46
47 for b in \
48                 quilt-tip-2             \
49                 gitish-only             \
50                 quilt-tip-1.1           \
51                 patch-queue/quilt-tip   \
52                 indep-arch              \
53 ; do
54         git branch -D $b
55 done
56
57 : 'see what gbp import-orig does'
58 git checkout master
59 gbp import-orig --upstream-version=2.0 ../$ust
60
61 not-gdr-processable
62
63 t-dch-commit -v 2.0-1 -m 'new upstream (did gbp import-orig)'
64 t-dch-commit -r sid
65
66 t-archive-none $p
67 t-git-none
68 t-dgit -wgf --gbp push-source --new
69
70 t-salsa-add-remote
71 git push --set-upstream origin master
72
73 # OK now this looks like something more normal.
74 # We have:
75 #  maintainer (gbp) view                dgit view
76 #    master
77 #    debian/2.0-1                          archive/debian/2.0-1
78 #    remotes/origin/master                 remotes/dgit/dgit/sid
79
80 t-git-debrebase -fupstream-has-debian convert-from-gbp
81
82 v=2.0-2
83 dch -v $v -m 'switch to git-debrebase, no other changes'
84 dch -r sid
85 git commit -m changelog debian/changelog
86
87 t-dgit -wgf push-source --new --overwrite
88 git push
89
90 cd ..
91
92 t-archive-process-incoming sid
93
94 t-setup-done '' "$(echo $p*) git mirror salsa aq" '
95         . $troot/lib-gdr
96         t-tstunt-parsechangelog
97         p=example
98 '
99
100 t-ok