Re: Confused about branches and partial switches
From: BRM <bm_witness_at_yahoo.com>
Date: Thu, 9 Jul 2009 17:34:27 -0700 (PDT)
I think you got the process wrong, possibly due to a mis-understanding - most likely of the use of svn switch as it relates.
If I am not mistaken, you are branching from below trunk - e.g. http://svn/svn/project/trunk/a/b/mystuff
If you can't compile in that form, then branch the trunk.
And per the error message, I'm not 100% sure, but 'svn cleanup' may resolve part of the issue.
This should resolve the problems you described.
Now, as per merging -
No, you don't need to delete the branch and then re-create it every time. It's an easy thing to do, and if the changes are great enough, then you may want to. You can also do a two way merge - merge changes from 'trunk' to your branch, and at least personally I find this useful to do before merging the branch back to the mainline trunk as it means there will typically be less work in getting trunk back to a working state after your changes are applied (since you theoretically did it in your branch) - only a downfall if trunk changes too fast, but then there would likely be other problems...
Any how...here's what I recommend:
1) Branch trunk to your branch area (svn copy http://svn/svn/project/trunk http://svn/svn/project/branches/brett/branch-name)
Supposing you didn't have to fix anything more, your commit at the end of #4 and your commit at the end of #3 should yield identical branches.
Now, svn 1.5.x and 1.6.x have some extra merge support functionality to help with integrating branches, so there may be a few better commands for doing this. (I'm using a 1.4.x server, so I don't get that benefit and can't speak as to the syntax.)So others may chime in with a better way to do the same thing, but that's the gist of it.
I'm relatively new to subversion, having started using it with version 1.6.2 just a few weeks ago. I have prior experience with CVS, Perforce, and a bit with AccuRev. So I'm not new to SCM.
Today I tried using svn branches for the second time, and once again it seems to be ending badly. Very frustrating. But maybe with some help I can make things work.
I'm working on one part of our source tree, several directories below the top. My desire is to do my development in a private branch so that I can do frequent commits without messing up the trunk. Whenever I have code worth sharing, I'll merge those changes into the trunk. Since I'm the only one working on these files, the merges should be one-way and painless. I'd like to continue working in the branch, merging back to trunk as needed.
So I created a branch of the tree, and then tried to "switch" my work subdirectory to the branch. Apparently I got the switch syntax horribly wrong, because it started checking out a whole new tree below my subdirectory, and left my work area in a confused state when I interrupted it with ^C. Now it claims some of my files have conflicts and "local edit, incoming delete upon switch". It won't let me update because mysterious subdirectories it somehow believes should be present are missing. Luckily I backed up all modified files before trying the dangerous svn switch command, so I'm now in the process of starting over with a clean checkout.
My first question is why doesn't svn switch support the --dry-run option? Is there something comparable? I now fear that command.
My second question is what exactly is the correct syntax for switching a subdirectory to a branch?
For the sake of argument, let's say the trunk path is http://svn/svn/project/trunk, my branch is http://svn/svn/project/branches/brett, and I'm working in the subdirectory whose URL is http://svn/svn/project/trunk/a/b/mystuff
What I tried, while in the a/b/mystuff directory of my workarea, was "svn switch ^/branches/brett"
My last question is do I really need to delete and recreate my branch after each merge to trunk? This seems to be the prevailing wisdom on the articles I've found, but I find it's often hard to tell whether or not svn branching advice applies to svn 1.6 or only earlier versions with more primitive branching support.
I really like the AccuRev concept of lightweight private branches so you can do frequent private commits ("keep" in accurev) without breaking the trunk. svn branches seem to be almost capable of this kind of usage model, but my experience so far has been, uh, unsatisfactory.
All help and advice appreciated!
-- Brett Coon - email@example.com - http://brettcoon.smugmug.com ------------------------------------------------------ http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2369543 To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].Received on 2009-07-10 02:35:59 CEST
This is an archived mail posted to the Subversion Users mailing list.