view tests/fixtures/branch_rename_to_trunk.sh @ 1236:f367a4462191

push: update to branch tip instead of tip We previously updated to the repository tip after pushing a revision, presumably on the assumption that tip would be the last revision we just pushed. This assumption is flawed for high traffic repositories. In particular, you previsouly would sometimes end up on a completley unrelated commit if someone else commits to a different branch in between the time we push a revision and pull it back from the server. This changes to instead update to the branch tip of the branch we were on at the beginning of the push. This should be either the revision we just pushed or a linear descendent of the revision we just pushed, with a fair degree of reliability.
author David Schleimer <dschleimer@fb.com>
date Sat, 30 Aug 2014 09:23:31 -0700
parents 2242dd1163c6
children
line wrap: on
line source

#!/bin/sh
mkdir temp
cd temp
svnadmin create repo
svn co file://`pwd`/repo wc
cd wc
mkdir branches trunk tags
svn add *
svn ci -m 'btt'
cd trunk
for a in alpha beta gamma delta ; do
    echo $a > $a
    svn add $a
done
svn ci -m 'Add files.'
cd ..
svn up
svn cp trunk branches/dev_branch
svn ci -m 'branch'
cd branches/dev_branch
svn rm delta
echo narf > alpha
echo iota > iota
svn add iota
svn ci -m 'branch changes'
cd ../..
svn up
svn mv trunk branches/old_trunk
svn ci -m 'move trunk to a branch'
svn up
svn mv branches/dev_branch trunk
svn ci -m 'move dev to trunk'
cd ..
cd ..
svnadmin dump temp/repo > branch_rename_to_trunk.svndump
echo
echo 'Complete.'
echo 'You probably want to clean up temp now.'
echo 'Dump in branch_rename_to_trunk.svndump'
exit 0