Skip to content

Instantly share code, notes, and snippets.

@apk
Created August 11, 2011 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apk/1139064 to your computer and use it in GitHub Desktop.
Save apk/1139064 to your computer and use it in GitHub Desktop.
Lose data in svn merge in four steps (branch, move dir here, modify content there, merge: mods lost)
set -xe
rm -rf repo wc
URL=file:///`pwd`/repo
time svnadmin create repo
time svn mkdir $URL/tr -m 'base dir'
time svn checkout $URL/tr wc
cd wc
mkdir A
cat >A/B <<EOF
package A
blah B
EOF
cat >A/D <<EOF
package A
blah D
EOF
svn add A
svn commit -m 'add A'
svn cp $URL/tr $URL/br -m 'make branch'
svn switch $URL/br
svn mv A C
cat >C/B <<EOF
package C
blah B
EOF
cat >C/D <<EOF
package C
blah D
EOF
svn commit -m 'move A to C'
svn switch $URL/tr
echo "Additional A/B" >>A/B
#cat >A/E <<EOF
# package A
# blah E
#EOF
svn commit -m 'update A/B'
svn up
svn merge --reintegrate $URL/br
cat A/B || true
: There should be 'Additional A/B' in here
cat C/B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment