You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gilad Benjamini <gi...@gmail.com> on 2008/12/03 20:49:33 UTC

Late Branching

I have a slightly complex situation I am trying to get out of.

 

For a new feature I am writing, I added some code in our trunk, including
adding new directories, a small number of new files, and minor modifications
in existing files.

A recent decision concluded that this feature should not be included in the
trunk, but is expected to be part of the trunk in a few months.

Meanwhile, I want to continue working on this feature in a separate branch.

 

Had the decision been made in the first place, creating a branch and working
there would have been simple.

Given my already made changes, it's not.

 

What's my best strategy for handling this ?

 

Since I don't regularly read this list, I would appreciate a response by
mail as well.

 

TIA

Gilad

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=979110

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Late Branching

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Dec 03, 2008 at 12:49:33PM -0800, Gilad Benjamini wrote:
> 
>    I have a slightly complex situation I am trying to get out of.
> 
> 
>    For a new feature I am writing, I added some code in our trunk,
>    including adding new directories, a small number of new files, and
>    minor modifications in existing files.
> 
>    A recent decision concluded that this feature should not be included
>    in the trunk, but is expected to be part of the trunk in a few months.
> 
>    Meanwhile, I want to continue working on this feature in a separate
>    branch.
> 
> 
>    Had the decision been made in the first place, creating a branch and
>    working there would have been simple.
> 
>    Given my already made changes, it's not.
> 
> 
>    What's my best strategy for handling this ?

What about creating the feature branch from trunk now,
and then reverting on trunk the changes you made for the feature?

That would give you a feature branch to continue working on.
Once your changes have been backed out of trunk, you pretty
much have the situation you'd like to have -- the branch has
the feature, and trunk does not.

Assuming you are using Subversion 1.5.x (i.e. you have merge-tracking):

The only thing you have to be careful about is not to merge the
reverse of your changes to your branch when you sync it to trunk
for the first time. That is, the 'undo' of your feature on trunk
must not be merged to your branch. You want to keep the feature on
the branch.

The trick needed here is to 'fake' mergeinfo on the branch.

You can achieve this by doing a --record-only merge from trunk
into your branch which should include the revisions[*] in which your
changes were reverted on trunk. Subversion will then recognise
these revisions as already merged into the branch, even though the
changes made in these revisions were not in fact applied to the branch.
After this record-only merge, Subversion won't ever undo your changes
on the branch, so future syncs to trunk should be safe and straightforward.

Does this make sense?

Stefan

[*] If you can, revert the feature in trunk in a single commit.
That should make the record-only merge a bit easier to handle
because you will only have to specify a single revision.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=979188

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: Late Branching

Posted by Gilad Benjamini <gi...@gmail.com>.
So let me see if I got this right.

- svn copy product/trunk@HEAD product/myfeature
- for each commit I already made
	- svn merge -c -<revision-num> product/trunk
- commit the changes

At this point I'll have both branches where I want them.
Once my feature needs to go back to the trunk
	- cd product/trunk
	- svn merge myfeature .

Is that it ?

> -----Original Message-----
> From: Blair Zajac [mailto:blair@orcaware.com]
> Sent: Wednesday, December 03, 2008 2:47 PM
> To: Tyler
> Cc: users@subversion.tigris.org; Gilad Benjamini
> Subject: Re: Late Branching
> 
> Tyler wrote:
> > On Wed, Dec 03, 2008 at 12:49:33PM -0800, Gilad Benjamini wrote:
> >> For a new feature I am writing, I added some code in our trunk,
> including
> >> adding new directories, a small number of new files, and minor
> modifications
> >> in existing files.
> >>
> >> A recent decision concluded that this feature should not be included
> in the
> >> trunk, but is expected to be part of the trunk in a few months.
> >>
> >> Meanwhile, I want to continue working on this feature in a separate
> branch.
> >
> > I would back ("reverse merge") your changes out of the trunk, cut a
> new
> > branch, then merge your changes original into that branch.
> 
> Better yet would be to copy the branch from the trunk at HEAD (before
> reverse
> merging) then do only a single reverse merge of the commits that
> shouldn't be in
> trunk.  No need to merge the changes into the branch.
> 
> Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=979290

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Late Branching

Posted by Blair Zajac <bl...@orcaware.com>.
Tyler wrote:
> On Wed, Dec 03, 2008 at 12:49:33PM -0800, Gilad Benjamini wrote:
>> For a new feature I am writing, I added some code in our trunk, including
>> adding new directories, a small number of new files, and minor modifications
>> in existing files.
>>
>> A recent decision concluded that this feature should not be included in the
>> trunk, but is expected to be part of the trunk in a few months.
>>
>> Meanwhile, I want to continue working on this feature in a separate branch.
> 
> I would back ("reverse merge") your changes out of the trunk, cut a new
> branch, then merge your changes original into that branch.

Better yet would be to copy the branch from the trunk at HEAD (before reverse 
merging) then do only a single reverse merge of the commits that shouldn't be in 
trunk.  No need to merge the changes into the branch.

Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=979181

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Late Branching

Posted by Tyler <ty...@cryptio.net>.
On Wed, Dec 03, 2008 at 12:49:33PM -0800, Gilad Benjamini wrote:
> For a new feature I am writing, I added some code in our trunk, including
> adding new directories, a small number of new files, and minor modifications
> in existing files.
> 
> A recent decision concluded that this feature should not be included in the
> trunk, but is expected to be part of the trunk in a few months.
> 
> Meanwhile, I want to continue working on this feature in a separate branch.

I would back ("reverse merge") your changes out of the trunk, cut a new
branch, then merge your changes original into that branch.

hth,
tyler

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=979179

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].