chiark / gitweb /
git-debrebase: test suite: gdr-import-dgit: extend
[dgit.git] / tests / tests / quilt
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-archive ruby-rails-3.2 3.2.6-1
6 t-git-none
7
8 mkdir -p incoming
9 cd incoming
10 t-worktree test
11 cd ..
12
13 t-dgit clone $p
14
15 cd $p
16 t-cloned-fetched-good
17
18 git fetch $tmp/incoming/$p dgit/sid:incoming
19
20 dummy=0
21
22 iteration () {
23         dummy=$(( $dummy + 1))
24         v=3.2.6-2~dummy${dummy}
25
26         t-refs-same-start
27         t-dgit --dpkg-buildpackage:-d build
28         t-dgit push
29         t-pushed-good dgit/sid
30 }
31
32 git cherry-pick -x incoming~1; iteration
33 git cherry-pick -x incoming~0; iteration
34
35 git fetch $tmp/incoming/$p incoming-branch:branch
36 git checkout branch
37 git rebase --onto dgit/sid incoming
38 git checkout dgit/sid
39 git merge branch
40 iteration
41
42 diff <<END - debian/patches/series
43 ups-topic/ups-yml
44 spongiform-upstream-new-file-incl-change.patch
45 zorkmid-options-=-42.patch
46 END
47
48 for f in `cat debian/patches/series`; do
49         egrep -q '^From.*ijackson@chiark' debian/patches/$f
50 done
51
52 t-822-field ../${p}_${v}_*.changes Changes |
53  grep -Fx 'ruby-rails-3.2 (3.2.6-2~dummy1) unstable; urgency=low'
54
55 t-git-next-date
56
57 # Now we are going to check that our dgit-generated patches round
58 # trip to similar git commits when imported by gbp pq:
59
60 git clean -xdf
61
62 # We need to make a patches-unapplied version
63 unpa=$(git log --pretty=format:'%H' --grep '^\[dgit import unpatched')
64 git checkout -b for-gbp
65 git reset "$unpa" .
66 git reset HEAD debian
67 git commit -m UNAPPY
68 git reset --hard
69 git clean -xdf
70
71 export GIT_AUTHOR_NAME='Someone Else'
72 export GIT_AUTHOR_EMAIL='else@example.com'
73 export GIT_COMMITTER_NAME='Someone Else'
74 export GIT_COMMITTER_EMAIL='else@example.com'
75
76 gbp pq import
77
78 for compare in $(git log --pretty='format:%H' \
79         --grep 'Change something in the upstream yml')
80 do
81         git cat-file commit $compare >../this.cmp
82         # normalise
83         perl -i~$compare~ -0777 -pe '
84                 s/\n+$//; $_ .= "\n";
85                 s/^(?:committer|parent|tree) .*\n//gm;
86                 s/\n+(\(cherry picked from .*\)\n)\n*/\n\n/m
87                         and s/$/$1/;
88                 s/\n+$//; $_ .= "\n";
89         ' ../this.cmp
90         if test -f ../last.cmp; then
91                 diff -u ../last.cmp ../this.cmp
92         fi
93         mv ../this.cmp ../last.cmp
94 done
95
96 t-ok