Files
chromium_depot_tools/tests/submodule-merge-test.sh
r.c.ladan@gmail.com ec238db2ad Invoke the bash shell via /usr/bin/env so that these scripts run on operating systems without /bin/bash too.
TEST=run "git cl owners" on FreeBSD
BUG=

Review URL: https://codereview.chromium.org/197213008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@274320 0039d316-1c4b-4281-b951-d872f2087c98
2014-06-02 20:39:42 +00:00

59 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
. ./test-lib.sh
setup_initsvn
setup_gitsvn_submodule
(
set -e
prev_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \
sed s/^.*:// | xargs`
cd git-svn-submodule
git config rietveld.server localhost:1
git checkout -q --track -b work
echo "some work done" >> test
git add test; git commit -q -m "work \
TBR=foo"
git_diff=`git diff HEAD^ | sed -n '/^@@/,$p' | xargs`
test_expect_success "dcommitted code" \
"$GIT_CL dcommit -f --bypass-hooks -m 'dcommit'"
cd ..
next_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \
sed s/^.*:// | xargs`
test_expect_success "svn got new revision" \
"test $next_svn_revision = `expr $prev_svn_revision + 1`"
svn_diff=`svn diff -c $next_svn_revision file://$PWD/svnrepo | \
sed -n '/^@@/,$p' | xargs`
test_expect_success "svn diff is correct" \
"test \"$git_diff\" = \"$svn_diff\""
cd git-svn-submodule
git svn fetch
last_svn_rev=`git show refs/remotes/trunk | grep git-svn-id: | \
grep -o trunk@[0-9]* | xargs`
test_expect_success "git svn fetch gets new svn revision" \
"test $last_svn_rev = trunk@$next_svn_revision"
)
SUCCESS=$?
#cleanup
if [ $SUCCESS == 0 ]; then
echo PASS
fi