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

Re: branching several times a day (was Re: Sourcesafe user needs primer on branching source control)

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-03-12 21:03:28 CET

Rob van Oostrum wrote:
>

Having just been using svk to do exactly this sort of thing, I can comment on
this directly.

> - it destroys the integrity of the private branch.

Except that the private branch is not very helpful if the changes to the trunk
conflict. It is better to merge to the branch and deal with the conflicts
there, than it is do so on the trunk. Specifically, if changes on the trunk
break what was done on the branch, you are going to have to spend more time
integrating the changes to the trunk (since you don't already know that the
merge from branch to trunk will be clean).

> - it duplicates changes over a multitude of branches.

As you said, drivespace is cheap. It is also the only way to truly distribute
to code for effective offline development.

For example, this was a recent round of changes using svk:

1. Get all of the master repository changes
        $ svk sync //svn/trunk

2. Check to see that the master and local don't conflict
        $ svk smerge -C //svn/trunk //svn/local/trunk

3. Actually perform the merge from trunk to local branch (if no conflicts)
        $ svk smerge //svn/trunk //svn/local/trunk

3b. Conflicts require special handling
        $ svk co //svn/local/trunk /tmp/conflict-trunk
        $ cd /tmp/conflict-trunk
        $ svk smerge //svn/trunk .
   [fix the conflict and test]
        $ svk resolved path/to/conflicted/file
        $ svk ci -m 'merge with trunk and resolve conflicts'
        $ cd -
        $ rm -rf conflict-trunk

4. And finally update the local working copy
        $ svk up
        
(note that if your WC was up to date, you wouldn't need to use a temporary WC to
resolve the conflicts and you could skip step 4 if you just did the integration
there).

5. At this point, you can go in the other direction to promote your branch
changes to the trunk
        $ svk smerge -C //svn/local/trunk //svn/trunk
        $ svk smerge -l //svn/local/trunk //svn/trunk
        $ svk sync //svn/trunk
        
(note that you need write access to the remote repository to make use of that
last line).

If you want to get only the changes that occurred on the branch, you can do this:

        $ svk diff //svn/trunk //svn/local/trunk > local.changes

and this diff will apply to the trunk cleanly, since you just synchronized with
the trunk.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Mar 12 21:03:34 2004

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