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

Re: Late Branching

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 3 Dec 2008 23:02:28 +0000

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_at_subversion.tigris.org].
Received on 2008-12-04 00:03:33 CET

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.