t / t9103-git-svn-graft-branches.shon commit Merge branch 'maint' (27e4dd8)
   1test_description='git-svn graft-branches'
   2. ./lib-git-svn.sh
   3
   4svnrepo="$svnrepo/test-git-svn"
   5
   6test_expect_success 'initialize repo' "
   7        mkdir import &&
   8        cd import &&
   9        mkdir -p trunk branches tags &&
  10        echo hello > trunk/readme &&
  11        svn import -m 'import for git-svn' . $svnrepo &&
  12        cd .. &&
  13        svn cp -m 'tag a' $svnrepo/trunk $svnrepo/tags/a &&
  14        svn cp -m 'branch a' $svnrepo/trunk $svnrepo/branches/a &&
  15        svn co $svnrepo wc &&
  16        cd wc &&
  17        echo feedme >> branches/a/readme &&
  18        svn commit -m hungry &&
  19        svn up &&
  20        cd trunk &&
  21        svn merge -r3:4 $svnrepo/branches/a &&
  22        svn commit -m 'merge with a' &&
  23        cd ../.. &&
  24        svn log -v $svnrepo &&
  25        git-svn init -i trunk $svnrepo/trunk &&
  26        git-svn init -i a $svnrepo/branches/a &&
  27        git-svn init -i tags/a $svnrepo/tags/a &&
  28        git-svn fetch -i tags/a &&
  29        git-svn fetch -i a &&
  30        git-svn fetch -i trunk
  31        "
  32
  33r1=`git-rev-list remotes/trunk | tail -n1`
  34r2=`git-rev-list remotes/tags/a | tail -n1`
  35r3=`git-rev-list remotes/a | tail -n1`
  36r4=`git-rev-list remotes/a | head -n1`
  37r5=`git-rev-list remotes/trunk | head -n1`
  38
  39test_expect_success 'test graft-branches regexes and copies' "
  40        test -n "$r1" &&
  41        test -n "$r2" &&
  42        test -n "$r3" &&
  43        test -n "$r4" &&
  44        test -n "$r5" &&
  45        git-svn graft-branches &&
  46        grep '^$r2 $r1' $GIT_DIR/info/grafts &&
  47        grep '^$r3 $r1' $GIT_DIR/info/grafts &&
  48        grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r4' | grep '$r1'
  49        "
  50
  51test_debug 'gitk --all & sleep 1'
  52
  53test_expect_success 'test graft-branches with tree-joins' "
  54        rm $GIT_DIR/info/grafts &&
  55        git-svn graft-branches --no-default-regex --no-graft-copy -B &&
  56        grep '^$r3 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r2' &&
  57        grep '^$r2 $r1' $GIT_DIR/info/grafts &&
  58        grep '^$r5 ' $GIT_DIR/info/grafts | grep '$r1' | grep '$r4'
  59        "
  60
  61# the result of this is kinda funky, we have a strange history and
  62# this is just a test :)
  63test_debug 'gitk --all &'
  64
  65test_done