[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: tree conflicts with replace

From: Neels Janosch Hofmeyr <neels_at_elego.de>
Date: Thu, 13 Aug 2009 02:45:37 +0200

Neels Janosch Hofmeyr wrote:
> stsp received this issue on IRC from "KeeperOfTheSoul" on June 11th, his
> paste was called m201b7297, which is attached in slightly tweaked form.

and here it is.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2383091

#!/bin/sh

set -e

cwd=`pwd`
basename=`basename $0`
scratch_area="`echo $basename | sed -e s/\.sh$//`"
repos=$scratch_area/repos
trunk1=$scratch_area/trunk1
trunk2=$scratch_area/trunk2
trunk_url=file:///$cwd/$repos/trunk

set -x
set +e

rm -rf $scratch_area
mkdir $scratch_area

# create a file to import
mkdir -p $trunk1
echo alpha > $trunk1/alpha

# import into new repos
svnadmin create $cwd/$repos
svn import $trunk1 $trunk_url -m "importing project tree"

# get clean checkouts
rm -rf $trunk1
svn checkout $trunk_url $trunk1
svn checkout $trunk_url $trunk2

# replace alpha in both WCs, with conflicting content.
svn delete $trunk1/alpha
svn delete $trunk2/alpha
echo beta1 > $trunk1/alpha
echo beta2 > $trunk2/alpha
svn add $trunk1/alpha
svn add $trunk2/alpha

# commit only the one replace
svn commit $trunk1 -m "replacing alpha in trunk"

#set +x
#echo
#echo PREMATURE EXIT
#echo $trunk2
#exit 0

# try to handle this in the other WC
svn update $trunk2
svn status $trunk2
svn info $trunk2/alpha
svn revert $trunk2/alpha
svn status $trunk2
svn info $trunk2/alpha
mv $trunk2/alpha $trunk2/alpha.tmp
svn update $trunk2

svn status $trunk2
cat $trunk2/alpha

Received on 2009-08-13 02:49:13 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.