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

Re: Merging from Branch from Working Copy

From: Dan Mahn <svn_at_digidescorp.com>
Date: 2006-04-30 04:48:19 CEST

Ryan Schmidt wrote:
>
> On Apr 28, 2006, at 20:05, Dan Mahn wrote:
>
>> - I modified my working copy, creating a new directory and then moving
>> a couple files into it.
>>
>> - Next, I created a branch from the working copy.
>
> If I understand correctly, and you did not do a commit between these two
> steps, then the (or at least a) problem is that you did two tasks in one
> commit: creating a branch, and modifying files. Those are distinct
> tasks, and should therefore be two commits. As it is now, you have a
> branch, but its first revision does not correspond any state of the
> trunk. So reasonable merging is now not possible.
>

Yes, there was a single commit for both of these steps.

> You should first create the branch, matching some revision of the trunk,
> and then you can change the branch as you like.
>
> svn cp $URL/trunk $URL/branches/my-branch -m "Making my-branch"
> svn co $URL/branches/my-branch
> # edit, edit, edit, add, delete
> svn ci -m "Committing changes to my-branch"
>
> If you already had a working copy of trunk and had already made changes
> and only then realized that you wanted to make these edits on a new
> branch, then you should first create the branch as above, then switch
> your working copy to the branch, then commit the changes.
>
> svn cp $URL/trunk $URL/branches/my-branch -m "Making my-branch"
> cd working-copy-with-changes
> svn switch $URL/branches/my-branch
> svn ci -m "Committing changes to my-branch"
>

Yes, I thought of that after I found the problem with merging. I
mentioned this technique to someone in the office, and they thought it
was too complicated to expect someone to create a branch and then switch
to it in order to commit the changes.

I understand that what I did was somewhat unorthodox, but if someone
ends up doing this, he has created a problem that can't be easily
resolved. If you can't create a branch from your working copy, then why
is it even an option?

- Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Apr 30 04:49:28 2006

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.