| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Abort on error. | 3 # Abort on error. |
| 4 set -e | 4 set -e |
| 5 | 5 |
| 6 PWD=`pwd` | 6 PWD=`pwd` |
| 7 REPO_URL=file://$PWD/svnrepo | 7 REPO_URL=file://$PWD/svnrepo |
| 8 TRUNK_URL=$REPO_URL/trunk |
| 9 BRANCH_URL=$REPO_URL/branches/some_branch |
| 8 GITREPO_PATH=$PWD/gitrepo | 10 GITREPO_PATH=$PWD/gitrepo |
| 9 GITREPO_URL=file://$GITREPO_PATH | 11 GITREPO_URL=file://$GITREPO_PATH |
| 10 GIT_CL=$PWD/../git-cl | 12 GIT_CL=$PWD/../git-cl |
| 11 | 13 |
| 12 # Set up an SVN repo that has a few commits to trunk. | 14 # Set up an SVN repo that has a few commits to trunk. |
| 13 setup_initsvn() { | 15 setup_initsvn() { |
| 14 echo "Setting up test SVN repo..." | 16 echo "Setting up test SVN repo..." |
| 15 rm -rf svnrepo | 17 rm -rf svnrepo |
| 16 svnadmin create svnrepo | 18 svnadmin create svnrepo |
| 17 | |
| 18 # Need this in order for Mac SnowLeopard to work | 19 # Need this in order for Mac SnowLeopard to work |
| 19 echo "enable-rep-sharing = false" >> svnrepo/db/fsfs.conf | 20 echo "enable-rep-sharing = false" >> svnrepo/db/fsfs.conf |
| 20 | 21 |
| 22 svn mkdir -q -m 'creating trunk' --parents $TRUNK_URL |
| 23 |
| 21 rm -rf svn | 24 rm -rf svn |
| 22 svn co -q $REPO_URL svn | 25 svn co -q $TRUNK_URL svn |
| 23 ( | 26 ( |
| 24 cd svn | 27 cd svn |
| 25 echo "test" > test | 28 echo "test" > test |
| 26 svn add -q test | 29 svn add -q test |
| 27 svn commit -q -m "initial commit" | 30 svn commit -q -m "initial commit" |
| 28 echo "test2" >> test | 31 echo "test2" >> test |
| 29 svn commit -q -m "second commit" | 32 svn commit -q -m "second commit" |
| 30 ) | 33 ) |
| 34 |
| 35 svn cp -q -m 'branching' --parents $TRUNK_URL $BRANCH_URL |
| 31 } | 36 } |
| 32 | 37 |
| 33 # Set up a git-svn checkout of the repo. | 38 # Set up a git-svn checkout of the repo. |
| 34 setup_gitsvn() { | 39 setup_gitsvn() { |
| 35 echo "Setting up test git-svn repo..." | 40 echo "Setting up test git-svn repo..." |
| 36 rm -rf git-svn | 41 rm -rf git-svn |
| 37 # There appears to be no way to make git-svn completely shut up, so we | 42 # There appears to be no way to make git-svn completely shut up, so we |
| 38 # redirect its output. | 43 # redirect its output. |
| 39 git svn -q clone $REPO_URL git-svn >/dev/null 2>&1 | 44 git svn -q clone -s $REPO_URL git-svn >/dev/null 2>&1 |
| 40 } | 45 } |
| 41 | 46 |
| 42 # Set up a git repo that has a few commits to master. | 47 # Set up a git repo that has a few commits to master. |
| 43 setup_initgit() { | 48 setup_initgit() { |
| 44 echo "Setting up test upstream git repo..." | 49 echo "Setting up test upstream git repo..." |
| 45 rm -rf gitrepo | 50 rm -rf gitrepo |
| 46 mkdir gitrepo | 51 mkdir gitrepo |
| 47 | 52 |
| 48 ( | 53 ( |
| 49 cd gitrepo | 54 cd gitrepo |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return $exit_code | 96 return $exit_code |
| 92 fi | 97 fi |
| 93 } | 98 } |
| 94 | 99 |
| 95 # Grab the XSRF token from the review server and print it to stdout. | 100 # Grab the XSRF token from the review server and print it to stdout. |
| 96 print_xsrf_token() { | 101 print_xsrf_token() { |
| 97 curl --cookie dev_appserver_login="test@example.com:False" \ | 102 curl --cookie dev_appserver_login="test@example.com:False" \ |
| 98 --header 'X-Requesting-XSRF-Token: 1' \ | 103 --header 'X-Requesting-XSRF-Token: 1' \ |
| 99 http://localhost:8080/xsrf_token 2>/dev/null | 104 http://localhost:8080/xsrf_token 2>/dev/null |
| 100 } | 105 } |
| OLD | NEW |