Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: tests/test-lib.sh

Issue 10543151: Add test for git-svn with submodule/merge layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/submodule-merge-test.sh ('k') | tests/upload-local-tracking-branch.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test-lib.sh
===================================================================
--- tests/test-lib.sh (revision 142106)
+++ tests/test-lib.sh (working copy)
@@ -1,5 +1,9 @@
#!/bin/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.
+
# Abort on error.
set -e
@@ -46,6 +50,28 @@
git svn -q clone -s $REPO_URL git-svn >/dev/null 2>&1
}
+# Set up a git-svn checkout of the repo and apply merge commits
+# (like the submodule repo layout).
+setup_gitsvn_submodule() {
+ echo "Setting up test remote git-svn-submodule repo..."
+ rm -rf git-svn-submodule
+ git svn -q clone -s $REPO_URL git-svn-submodule >/dev/null 2>&1
+ svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \
+ sed s/^.*:// | xargs`
+ (
+ cd git-svn-submodule
+ echo 'merge-file line 1' > merge-file
+ git add merge-file; git commit -q -m 'First non-svn commit on master'
+ git checkout -q refs/remotes/trunk
+ git merge -q --no-commit --no-ff refs/heads/master >/dev/null 2>&1
+ echo 'merge-edit-file line 1' > merge-edit-file
+ git add merge-edit-file
+ git commit -q -m "SVN changes up to revision $svn_revision"
+ git update-ref refs/heads/master HEAD
+ git checkout master
+ )
+}
+
# Set up a git repo that has a few commits to master.
setup_initgit() {
echo "Setting up test upstream git repo..."
@@ -74,7 +100,7 @@
}
cleanup() {
- rm -rf gitrepo svnrepo svn git-git git-svn
+ rm -rf gitrepo svnrepo svn git-git git-svn git-svn-submodule
}
# Usage: test_expect_success "description of test" "test code".
« no previous file with comments | « tests/submodule-merge-test.sh ('k') | tests/upload-local-tracking-branch.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698