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