chiark / gitweb /
git-debrebase: Rename new-upstream-v0 command to new-upstream
[dgit.git] / tests / tests / quilt-gbp
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 # `dgit build-source` cleans before applying patches.  However, the
6 # clean targets of 3.0 (quilt) packages are allowed to assume that
7 # patches are applied.  If they are not, the clean targets can
8 # misbehave in basically two ways:
9 #
10 # - fail to clean everything
11 # - error out and stop the build
12 #
13 # In this test, what we want to see is whether dgit detects that quilt
14 # fixup cannot be linear because the user has failed to pass --gbp.
15 # So we need to ensure the package's clean target does not error out,
16 # because that blocks dgit attempting quilt linearisation.  This
17 # environment variable tells the example package's clean target not to
18 # error out if it notices that patches have not yet been applied.
19 export DGIT_TEST_TOLERATE_UNPATCHED_CLEAN=true
20
21 t-tstunt-parsechangelog
22
23 t-gbp-example-prep
24
25 t-expect-fail 'quilt fixup cannot be linear' \
26   t-dgit build-source
27
28 t-git-config dgit-distro.test-dummy.dgit-tag-format new
29 t-expect-fail 'requires split view so server needs to support' \
30 t-dgit -wgf --quilt=gbp build-source
31 t-newtag
32
33 t-dgit --quilt=gbp --dgit-view-save=split.b1 build-source
34 git rev-parse split.b1
35
36 t-dgit --quilt=gbp --gbp-pq=no-such-command-gbp build-source
37
38 echo spong >debian/pointless-for-dgit-test
39 git add debian/pointless-for-dgit-test
40 git commit -m Pointless
41
42 t-expect-fail no-such-command-gbp \
43 t-dgit --quilt=gbp --clean=git --gbp-pq=no-such-command-gbp build-source
44
45 test-push-1 () {
46         t-refs-same-start
47         t-ref-head
48 }
49
50 test-push-2 () {
51         t-dgit --quilt=gbp --dgit-view-save=split.p push
52
53         t-gbp-pushed-good
54 }
55
56 test-push-1
57
58 t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
59
60 t-expect-fail "HEAD specifies a different tree to $p" \
61   t-dgit push
62
63 test-push-2
64
65 echo wombat >>debian/pointless-for-dgit-test
66 git add debian/pointless-for-dgit-test
67 git commit -m 'Pointless 2'
68
69 t-commit 'Check pseudomerge' 1.0-3
70
71 test-push-1
72
73 t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
74
75 test-push-2
76
77 t-ok