Mercurial > hg
changeset 12534:3ee3d7634e94
tests: unify test-convert-tagsbranch-topology
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Sep 2010 17:20:24 -0500 |
parents | 068449e515e2 |
children | 975ec4ce961c |
files | tests/test-convert-tagsbranch-topology tests/test-convert-tagsbranch-topology.out tests/test-convert-tagsbranch-topology.t |
diffstat | 3 files changed, 82 insertions(+), 83 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-convert-tagsbranch-topology Sun Sep 26 17:18:53 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -#!/bin/sh - -"$TESTDIR/hghave" git || exit 80 - -echo "[extensions]" >> $HGRCPATH -echo "convert=" >> $HGRCPATH -echo 'hgext.graphlog =' >> $HGRCPATH -echo '[convert]' >> $HGRCPATH -echo 'hg.usebranchnames = True' >> $HGRCPATH -echo 'hg.tagsbranch = tags-update' >> $HGRCPATH - -GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME -GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL -GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE -GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME -GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL -GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE - -count=10 -action() -{ - GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" - GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" - git "$@" >/dev/null 2>/dev/null || echo "git command error" - count=`expr $count + 1` -} - -glog() -{ - hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" -} - -convertrepo() -{ - hg convert --datesort git-repo hg-repo -} - -# Build a GIT repo with at least 1 tag -mkdir git-repo -cd git-repo -git init >/dev/null 2>&1 -echo a > a -git add a -action commit -m "rev1" -action tag -m "tag1" tag1 -cd .. - -# Do a first conversion -convertrepo - -# Simulate upstream updates after first conversion -cd git-repo -echo b > a -git add a -action commit -m "rev2" -action tag -m "tag2" tag2 -cd .. - -# Perform an incremental conversion -convertrepo - -# Print the log -cd hg-repo -glog
--- a/tests/test-convert-tagsbranch-topology.out Sun Sep 26 17:18:53 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -initializing destination hg-repo repository -scanning source... -sorting... -converting... -0 rev1 -updating tags -scanning source... -sorting... -converting... -0 rev2 -updating tags -o 3 "update tags" files: .hgtags -| -| o 2 "rev2" files: a -| | -o | 1 "update tags" files: .hgtags - / -o 0 "rev1" files: a -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-tagsbranch-topology.t Sun Sep 26 17:20:24 2010 -0500 @@ -0,0 +1,82 @@ + + $ "$TESTDIR/hghave" git || exit 80 + $ echo "[extensions]" >> $HGRCPATH + $ echo "convert=" >> $HGRCPATH + $ echo 'hgext.graphlog =' >> $HGRCPATH + $ echo '[convert]' >> $HGRCPATH + $ echo 'hg.usebranchnames = True' >> $HGRCPATH + $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH + $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME + $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL + $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE + $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME + $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL + $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE + $ count=10 + $ action() + > { + > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" + > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" + > git "$@" >/dev/null 2>/dev/null || echo "git command error" + > count=`expr $count + 1` + > } + $ glog() + > { + > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" + > } + $ convertrepo() + > { + > hg convert --datesort git-repo hg-repo + > } + +Build a GIT repo with at least 1 tag + + $ mkdir git-repo + $ cd git-repo + $ git init >/dev/null 2>&1 + $ echo a > a + $ git add a + $ action commit -m "rev1" + $ action tag -m "tag1" tag1 + $ cd .. + +Do a first conversion + + $ convertrepo + initializing destination hg-repo repository + scanning source... + sorting... + converting... + 0 rev1 + updating tags + +Simulate upstream updates after first conversion + + $ cd git-repo + $ echo b > a + $ git add a + $ action commit -m "rev2" + $ action tag -m "tag2" tag2 + $ cd .. + +Perform an incremental conversion + + $ convertrepo + scanning source... + sorting... + converting... + 0 rev2 + updating tags + +Print the log + + $ cd hg-repo + $ glog + o 3 "update tags" files: .hgtags + | + | o 2 "rev2" files: a + | | + o | 1 "update tags" files: .hgtags + / + o 0 "rev1" files: a +