summaryrefslogtreecommitdiff
path: root/tests/setup/gdr-convert-gbp
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-02-16 22:43:45 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 16:03:11 +0100
commitd980524cd66e12eda58f9df6bc8410454febd3aa (patch)
tree28d4bdc5ce2c3d019ce91bf8d979df74438578c9 /tests/setup/gdr-convert-gbp
parent4cffe29436a86c6aa974db00201cabae1448e0c7 (diff)
git-debrebase: rename gbp2gdr to convert-from-gbp
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/setup/gdr-convert-gbp')
-rwxr-xr-xtests/setup/gdr-convert-gbp100
1 files changed, 100 insertions, 0 deletions
diff --git a/tests/setup/gdr-convert-gbp b/tests/setup/gdr-convert-gbp
new file mode 100755
index 0000000..9bb9983
--- /dev/null
+++ b/tests/setup/gdr-convert-gbp
@@ -0,0 +1,100 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-gdr
+
+t-dependencies git-buildpackage libfile-fnmatch-perl
+
+t-tstunt-parsechangelog
+
+not-gdr-processable () {
+ t-git-debrebase analyse | grep 'Unknown Unprocessable'
+}
+
+p=example
+t-worktree 1.1
+
+cd example
+
+: 'fake up some kind of upstream'
+git checkout -b upstream quilt-tip
+rm -rf debian
+mkdir debian
+echo junk >debian/rules
+git add debian
+git commit -m "an upstream retcon ($0)"
+
+: 'fake up that our quilt-tip was descended from upstream'
+git checkout quilt-tip
+git merge --no-edit -s ours upstream
+
+: 'fake up that our quilt-tip had the patch queue in it'
+git checkout patch-queue/quilt-tip
+gbp pq export
+git add debian/patches
+git commit -m "patch queue update ($0)"
+
+not-gdr-processable
+
+: 'fake up an upstream 2.0'
+git branch make-upstream upstream
+t-make-new-upstream-tarball 2.0
+
+: 'make branch names more conventional'
+git branch -D master
+git branch -m quilt-tip master
+
+for b in \
+ quilt-tip-2 \
+ gitish-only \
+ quilt-tip-1.1 \
+ patch-queue/quilt-tip \
+ indep-arch \
+; do
+ git branch -D $b
+done
+
+: 'see what gbp import-orig does'
+git checkout master
+gbp import-orig --upstream-version=2.0 ../$ust
+
+not-gdr-processable
+
+t-dch-commit -v 2.0-1 -m 'new upstream (did gbp import-orig)'
+t-dch-commit -r sid
+
+t-archive-none $p
+t-git-none
+t-dgit -wgf --gbp push-source --new
+
+t-salsa-add-remote
+git push --set-upstream origin master
+
+# OK now this looks like something more normal.
+# We have:
+# maintainer (gbp) view dgit view
+# master
+# debian/2.0-1 archive/debian/2.0-1
+# remotes/origin/master remotes/dgit/dgit/sid
+
+t-git-debrebase -fupstream-has-debian convert-from-gbp
+
+v=2.0-2
+dch -v $v -m 'switch to git-debrebase, no other changes'
+dch -r sid
+git commit -m changelog debian/changelog
+
+t-dgit -wgf push-source --new --overwrite
+git push
+
+cd ..
+
+t-archive-process-incoming sid
+
+t-setup-done '' "$(echo $p*) git mirror salsa aq" '
+ . $troot/lib-gdr
+ t-tstunt-parsechangelog
+ p=example
+'
+
+t-ok