X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Flib;h=c51c4a6146a50230fed33afc80a41f78e222a08c;hp=9308b169e9636d8440956c965b1f819203ce6279;hb=fa22d8f771e63ca6fc17dea716980aa0faaf8f2f;hpb=ec22348eada556dc5f326186806890f34d5b6cc3 diff --git a/tests/lib b/tests/lib index 9308b169..c51c4a61 100644 --- a/tests/lib +++ b/tests/lib @@ -12,6 +12,9 @@ t-set-intree : ${DGIT_TEST_DEBUG=-D} export DGIT_TEST_DEBUG +export GIT_COMMITTER_DATE='1440253867 +0100' +export GIT_AUTHOR_DATE='1440253867 +0100' + root=`pwd` troot=$root/tests testname="${DGIT_TEST_TESTNAME-${0##*/}}" @@ -45,6 +48,11 @@ incoming = $tmp/incoming run_dinstall = 0 END +t-git-next-date () { + GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }" + GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE" +} + t-expect-fail () { local mpat="$1"; shift @@ -126,7 +134,7 @@ t-untar () { local tarfile=$1.tar local edittree=$1.edit if test -d "$edittree"; then - cp -al "$edittree"/* . + cp -a "$edittree"/* . else tar xf "$tarfile" fi @@ -504,6 +512,49 @@ t-apply-diff () { | patch -p1 -u } +t-gbp-unapplied-pq2qc () { + # does `gbp pq export' (leaving us on BRANCH (eg "quilt-tip")) + # commits the resulting debian/patches on qc/BRANCH + # goes back to patch-queue/BRANCH + # qc/BRANCH is not fast-forwarding + + gbp pq export + + branch=`git symbolic-ref HEAD` + branch=${branch#refs/heads/} + + case "$branch" in + */*) fail "unexpected branch $branch" ;; + esac + + git branch -f qc/$branch + git checkout qc/$branch + git add debian/patches + git commit -m 'Commit patch queue' + git checkout patch-queue/$branch +} + +t-gbp-example-prep () { + t-archive example 1.0-1 + t-git-none + t-worktree 1.0 + + cd example + + t-dgit fetch + + git-checkout -b patch-queue/quilt-tip-2 patch-queue/quilt-tip + gbp pq rebase + + echo '/* some comment */' >>src.c + git add src.c + git commit -m 'Add a comment to an upstream file' + + t-gbp-unapplied-pq2qc + + t-commit 'some updates' 1.0-2 +} + t-commit () { local msg=$1 v=${2-1.$revision}