summaryrefslogtreecommitdiff
path: root/tests/tests/gdr-newupstream
blob: d72971a8dd6443b9655f66f34796fc671e94d3ac (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
#!/bin/bash
set -e
autoimport=
. tests/lib

t-dependencies NO-DGIT GDR

t-tstunt-parsechangelog
t-setup-import gdr-convert-gbp-noarchive

cd $p

: 'upstream hat'

t-gdr-prep-new-upstream 2.1

: 'maintainer hat'

git branch startpoint
v=2.1-1

git checkout master

t-expect-fail F:'Could not determine appropriate upstream commitish' \
t-git-debrebase new-upstream $v

git tag v2.1 upstream

git branch before-new-upstream

t-git-debrebase new-upstream ${v%-*}

date=$(git log --format=%aD -n1 debian/changelog)
cat >../clog.expected <<END
example ($v) UNRELEASED; urgency=medium

  * Update to new upstream version ${v%-*}.

 -- dgit test git user <dgit-test@debian.example.net>  $date

END
git show before-new-upstream:debian/changelog >>../clog.expected
diff -u ../clog.expected debian/changelog

t-gdr-good laundered
git reflog | egrep 'debrebase new-upstream.*checkout'

t-git-debrebase stitch
t-gdr-good stitched

git branch ordinary

: 'with --anchor'

git reset --hard startpoint

t-git-debrebase analyse >../anal.anch
anchor=$(perl <../anal.anch -ne '
	next unless m/^(\w+) Anchor\s/;
	print $1,"\n";
	exit;
')

GIT_REFLOG_ACTION='STUNT-RLA' \
t-git-debrebase --anchor=$anchor -fanchor-treated new-upstream $v upstream
t-gdr-good laundered
git reflog | egrep 'STUNT-RLA: debrebase new-upstream'
git reflog | egrep 'STUNT-RLA: debrebase: launder for new upstream'

t-git-debrebase stitch
t-gdr-good stitched

git diff --quiet ordinary

t-ok