Mercurial > public > mercurial-scm > hg-stable
diff tests/test-convert-git @ 5380:a5a7f7fd5554
convert_git: add --filemap support
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 04 Oct 2007 23:21:37 -0300 |
parents | 8ab7de07f40e |
children | 7239e06e58e9 c1dc903dc7b6 |
line wrap: on
line diff
--- a/tests/test-convert-git Thu Oct 04 23:21:37 2007 -0300 +++ b/tests/test-convert-git Thu Oct 04 23:21:37 2007 -0300 @@ -4,6 +4,7 @@ echo "[extensions]" >> $HGRCPATH echo "convert=" >> $HGRCPATH +echo 'hgext.graphlog =' >> $HGRCPATH GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL @@ -54,3 +55,78 @@ hg convert --datesort git-repo hg -R git-repo-hg tip -v + +count=10 +mkdir git-repo2 +cd git-repo2 +git init-db >/dev/null 2>/dev/null + +echo foo > foo +git add foo +commit -a -m 'add foo' + +echo >> foo +commit -a -m 'change foo' + +git checkout -b Bar HEAD^ >/dev/null 2>/dev/null +echo quux >> quux +git add quux +commit -a -m 'add quux' + +echo bar > bar +git add bar +commit -a -m 'add bar' + +git checkout -b Baz HEAD^ >/dev/null 2>/dev/null +echo baz > baz +git add baz +commit -a -m 'add baz' + +git checkout master >/dev/null 2>/dev/null +git pull --no-commit . Bar Baz > /dev/null 2>/dev/null +commit -m 'Octopus merge' + +echo bar >> bar +commit -a -m 'change bar' + +git checkout -b Foo HEAD^ >/dev/null 2>/dev/null +echo >> foo +commit -a -m 'change foo' + +git checkout master >/dev/null 2>/dev/null +git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null +commit -m 'Discard change to foo' + +cd .. + +glog() +{ + hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@" +} + +splitrepo() +{ + msg="$1" + files="$2" + opts=$3 + echo "% $files: $msg" + prefix=`echo "$files" | sed -e 's/ /-/g'` + fmap="$prefix.fmap" + repo="$prefix.repo" + for i in $files; do + echo "include $i" >> "$fmap" + done + hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" + glog -R "$repo" + hg -R "$repo" manifest --debug +} + +echo '% full conversion' +hg -q convert --datesort git-repo2 fullrepo +glog -R fullrepo +hg -R fullrepo manifest --debug + +splitrepo 'octopus merge' 'foo bar baz' + +splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux' +