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

Possible BUG?: partial commit after switch, not possible to switch back

From: Reinhard Brandstaedter <Reinhard.Brandstaedter_at_jku.at>
Date: 2007-03-15 14:10:56 CET


I'm trying to work out a procedure how to do partial commits of changes
in a (multiple) switched WC. Maybe it's easier to describe this in an

What I'm trying to do:
1. check out trunk
2. _modify_ some files in this working copy
3. switch the working copy to a branch
   (the local modified files are kept even if they are not in the
   branch at all - good and I expected that)
4. _add_ and _commit_ some (not all!) of the modified files to the
5. switch the working copy back to trunk
6. commit the rest of the modified files (the ones I changed and did
   not commit into the branch) to trunk
7. merge the files (changes) I committed into the branch back into the
   trunk working copy

Steps 1.-4. works fine 5.-7. cause problems/are not possible.

This are the steps in detail:

reinhard@redchili /wkpkg-test $ ls
1.txt 3.txt
reinhard@redchili /wkpkg-test $ echo "change" > 1.txt
reinhard@redchili /wkpkg-test $ echo "change" > 3.txt
reinhard@redchili /wkpkg-test $ cd ..
reinhard@redchili /development $ cd wkpkg-test2/
reinhard@redchili /wkpkg-test2 $ echo "change" > a.txt
reinhard@redchili /wkpkg-test2 $ echo "change" > c.txt
reinhard@redchili /wkpkg-test2 $ cd ..
reinhard@redchili /development $ svn status
M wkpkg-test/3.txt
M wkpkg-test/1.txt
M wkpkg-test2/c.txt
M wkpkg-test2/a.txt

reinhard@redchili /development $ svn info
Path: .
URL: https://svn-zid.zid.jku.at/svn/sandbox/trunk/sandbox/development
Repository Root: https://svn-zid.zid.jku.at/svn/sandbox
Repository UUID: 38bd993a-0a1f-0410-be6b-c865c14f2943
Revision: 96
Node Kind: directory
Schedule: normal
Last Changed Author: rbrand
Last Changed Rev: 93
Last Changed Date: 2007-03-15 12:59:27 +0100 (Thu, 15 Mar 2007)

reinhard@redchili /development $ svn switch
D wkpkg-test/3.txt
A wkpkg-test/2.txt
D wkpkg-test2/c.txt
A wkpkg-test2/b.txt
D wkpkg-test3/III.txt
A wkpkg-test3/II.txt
Updated to revision 98.

reinhard@redchili /development $ svn status
? wkpkg-test/3.txt
M wkpkg-test/1.txt
? wkpkg-test2/c.txt
M wkpkg-test2/a.txt

reinhard@redchili /development $ svn diff wkpkg-test/1.txt
Index: wkpkg-test/1.txt
--- wkpkg-test/1.txt (revision 98)
+++ wkpkg-test/1.txt (working copy)
@@ -0,0 +1 @@

reinhard@redchili /development $ svn diff wkpkg-test2/a.txt
Index: wkpkg-test2/a.txt
--- wkpkg-test2/a.txt (revision 98)
+++ wkpkg-test2/a.txt (working copy)
@@ -0,0 +1 @@

reinhard@redchili /development $ svn commit -m "local changes made while
in trunk, then switch and commit them to branch"
Sending wkpkg-test/1.txt
Sending wkpkg-test2/a.txt
Transmitting file data ..
Committed revision 99.

reinhard@redchili /development $ svn switch
U wkpkg-test/1.txt
D wkpkg-test/2.txt
svn: Failed to add file 'wkpkg-test/3.txt': object of the same name
already exists

reinhard@redchili /development $ svn status
! .
? wkpkg-test/3.txt
! wkpkg-test
? wkpkg-test2/c.txt
    S wkpkg-test2
    S wkpkg-test3
    S wkpkg-cake
    S wkpkg-test4
    S wkpkg-test5
    S local.properties
    S wkpkg-sand
    S wkpkg-kitchen2
So the switch back to trunk fails because there is already a file 3.txt
in the working copy (which seems to be unversioned now).
As the switch command is a superset of the update I'd expect the same
behavior as with the update command: the switch to trunk should work
fine and should leave the files in a conflicted state (because there was
a local change and the file in the repository differs).
Maybe the SVN client has to track somewhere if 3.txt was a versioned
file before the switch so it can be set back to that safely after
switching back (like a switch history for the working copy).

I think this scenario I'm describing here is not so uncommon. Actually
it isn't my personal requirement to do things like that but I have
developers that need to switch back and forth and maybe have 100 files
modified in their working copy when switching and want only a few of
them in the branch and the rest in the trunk.

Maybe I'm completely wrong in my approach how to do this. But please
tell me how I could work-around this problem?


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 15 14:11:34 2007

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

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