Dear Subversion Users,
I am encountering some behavior with the switch command that I do not
understand. Basically if I have an unversioned file in my branch working
copy and try to do a switch to the trunk my working copy becomes all messed
up.
I have provided a script that reproduces the problem along with the output
when I run it on my machine (windows xp). I have turned on the echo so that
you can see the commands. The example I have here is working locally but I
get very similar behavior when I run against the svnserve that we have
running.
Note at the end of the output I am not able to do an update or a switch.
Furthermore the URL in the info command shows me at that top level of my
project when it should be either the trunk or the branch.
Thanks for any suggestions,
-Tim Ramsey
Anystream
21335 Signal Hill Plaza
Sterling, VA 20164
o: 703 948 3015
e: tramsey@anystream.com
>>>>>SCRIPT START<<<<<<
repo=c:/svn
proj=p1
projUrl=file:///$repo/$proj
trunk=$projUrl/trunk
branches=$projUrl/branches
b1=$branches/b1
# turn on echo
set -x
# set up the repo and check it out
svnadmin create $repo
svn mkdir -m"making the project." $projUrl
svn mkdir -m"making the project trunk." $trunk
svn mkdir -m"making the branches directory." $branches
svn co $trunk $proj
# make a couple of files and add them to Subversion
touch $proj/f1
svn add $proj/f1
touch $proj/f2
svn add $proj/f2
svn ci -m"made a pair of files." $proj
# create the branch
svn copy -m"made branch b1." $trunk $b1
# add a directory to the trunk
svn mkdir $proj/d1-trunk
svn ci -m"Added a directory to the trunk." $proj
# and then switch to the branch and add a directory
svn switch $b1 $proj
svn mkdir $proj/d2-branch
svn ci -m"Added a directory to the branch." $proj
# switch back and forth from the trunk to the branch
# no problem at all
svn switch $trunk $proj
svn switch $b1 $proj
# now add an unversioned file in the branch and try to switch
# to the trunk. This fails for me.
touch $proj/d2-branch/f3-branch
svn switch $trunk $proj
# and all these commands fail for me as well
# (except status and info which are just showing wrong stuff)
svn up $proj
svn switch $trunk $proj
svn switch $b1 $proj
svn status $proj
svn info $proj
>>>>>SCRIPT END<<<<<<
>>>>>OUTPUT START<<<<<<
+./script.sh:10> svnadmin create c:/svn
+./script.sh:11> svn mkdir -mmaking the project. file:///c:/svn/p1
Committed revision 1.
+./script.sh:12> svn mkdir -mmaking the project trunk.
file:///c:/svn/p1/trunk
Committed revision 2.
+./script.sh:13> svn mkdir -mmaking the branches directory.
file:///c:/svn/p1/branches
Committed revision 3.
+./script.sh:15> svn co file:///c:/svn/p1/trunk p1
Checked out revision 3.
+./script.sh:17> touch p1/f1
+./script.sh:18> svn add p1/f1
A p1\f1
+./script.sh:19> touch p1/f2
+./script.sh:20> svn add p1/f2
A p1\f2
+./script.sh:21> svn ci -mmade a pair of files. p1
Adding p1\f1
Adding p1\f2
Transmitting file data ..
Committed revision 4.
+./script.sh:22> svn copy -mmade branch b1. file:///c:/svn/p1/trunk
file:///c:/svn/p1/branches/b1
Committed revision 5.
+./script.sh:24> svn mkdir p1/d1-trunk
A p1\d1-trunk
+./script.sh:25> svn ci -mAdded a directory to the trunk. p1
Adding p1\d1-trunk
Committed revision 6.
+./script.sh:27> svn switch file:///c:/svn/p1/branches/b1 p1
D p1\d1-trunk
Updated to revision 6.
+./script.sh:28> svn mkdir p1/d2-branch
A p1\d2-branch
+./script.sh:29> svn ci -mAdded a directory to the branch. p1
Adding p1\d2-branch
Committed revision 7.
+./script.sh:31> svn switch file:///c:/svn/p1/trunk p1
A p1\d1-trunk
D p1\d2-branch
Updated to revision 7.
+./script.sh:32> svn switch file:///c:/svn/p1/branches/b1 p1
A p1\d2-branch
D p1\d1-trunk
Updated to revision 7.
+./script.sh:34> touch p1/d2-branch/f3-branch
+./script.sh:35> svn switch file:///c:/svn/p1/trunk p1
A p1\d1-trunk
svn: Won't delete locally modified directory 'p1'
svn: Left locally modified or unversioned files
+./script.sh:37> svn up p1
svn: Working copy 'p1/d2-branch' not locked
+./script.sh:38> svn switch file:///c:/svn/p1/trunk p1
svn: Working copy 'p1/d2-branch' not locked
+./script.sh:39> svn switch file:///c:/svn/p1/branches/b1 p1
svn: Working copy 'p1/d2-branch' not locked
+./script.sh:40> svn status p1
! p1
~ p1\d2-branch
S p1\d1-trunk
S p1\f1
S p1\f2
+./script.sh:41> svn info p1
Path: p1
URL: file:///c:/svn/p1
Repository UUID: 98c335f6-825e-2f48-a932-b39501d1bb3f
Revision: 7
Node Kind: directory
Schedule: normal
Last Changed Author: Administrator
Last Changed Rev: 7
Last Changed Date: 2004-04-07 15:12:18 -0400 (Wed, 07 Apr 2004)
>>>>>OUTPUT END<<<<<<
-Tim Ramsey
Anystream
21335 Signal Hill Plaza
Sterling, VA 20164
o: 703 948 3015
m: 703 963 2129
e: tramsey@anystream.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Apr 7 21:50:49 2004