t / t9158-git-svn-mergeinfo.shon commit t1500: test_rev_parse: facilitate future test enhancements (12f7526)
   1#!/bin/sh
   2#
   3# Copyright (c) 2010 Steven Walter
   4#
   5
   6test_description='git svn mergeinfo propagation'
   7
   8. ./lib-git-svn.sh
   9
  10say 'define NO_SVN_TESTS to skip git svn tests'
  11
  12test_expect_success 'initialize source svn repo' '
  13        svn_cmd mkdir -m x "$svnrepo"/trunk &&
  14        svn_cmd co "$svnrepo"/trunk "$SVN_TREE" &&
  15        (
  16                cd "$SVN_TREE" &&
  17                touch foo &&
  18                svn_cmd add foo &&
  19                svn_cmd commit -m "initial commit"
  20        ) &&
  21        rm -rf "$SVN_TREE"
  22'
  23
  24test_expect_success 'clone svn repo' '
  25        git svn init "$svnrepo"/trunk &&
  26        git svn fetch
  27'
  28
  29test_expect_success 'change svn:mergeinfo' '
  30        touch bar &&
  31        git add bar &&
  32        git commit -m "bar" &&
  33        git svn dcommit --mergeinfo="/branches/foo:1-10"
  34'
  35
  36test_expect_success 'verify svn:mergeinfo' '
  37        mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) &&
  38        test "$mergeinfo" = "/branches/foo:1-10"
  39'
  40
  41test_expect_success 'change svn:mergeinfo multiline' '
  42        touch baz &&
  43        git add baz &&
  44        git commit -m "baz" &&
  45        git svn dcommit --mergeinfo="/branches/bar:1-10 /branches/other:3-5,8,10-11"
  46'
  47
  48test_expect_success 'verify svn:mergeinfo multiline' '
  49        mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/trunk) &&
  50        test "$mergeinfo" = "/branches/bar:1-10
  51/branches/other:3-5,8,10-11"
  52'
  53
  54test_done