You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Noam Tamim <no...@gmail.com> on 2007/08/08 11:43:34 UTC

retroactive branch?

Hi,
A user has started a big change. He didn't create his own branch first, so
he's in the trunk. His work is still ongoing, but he needs to commit.
However in the current state, a commit will break the trunk.

Is it possible to somehow retroactively branch his work, and later merge
everything to the trunk?

Thanks, Noam.

Re: retroactive branch?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 8/8/07, Noam Tamim <no...@gmail.com> wrote:
> On 8/8/07, Martin Schröder <ma...@oneiros.de> wrote:
> > > Is it possible to somehow retroactively branch his work, and later merge
> > > everything to the trunk?
> > Seems so; the the bottom of
> >
> http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.copy.html
>
> Correct; the problem is really not retroactively BRANCHING, but
> retroactively SWITCHING to the branch. Is that possible? Will --relocate do
> it correctly?

You shouldn't use --relocate (generally). It's only applicable when
you have moved the path-location of the repository itself, not when
you want to switch to a different baseline to work on.

bye,

Erik.

Re: retroactive branch?

Posted by Noam Tamim <no...@gmail.com>.
On 8/8/07, Martin Schröder <ma...@oneiros.de> wrote:
>
> > Is it possible to somehow retroactively branch his work, and later merge
> > everything to the trunk?
> Seems so; the the bottom of
> http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.copy.html


Correct; the problem is really not retroactively BRANCHING, but
retroactively SWITCHING to the branch. Is that possible? Will --relocate do
it correctly?

Thanks, Noam.

Re: retroactive branch?

Posted by Martin Schröder <ma...@oneiros.de>.
2007/8/8, Noam Tamim <no...@gmail.com>:
> Is it possible to somehow retroactively branch his work, and later merge
> everything to the trunk?

Seems so; the the bottom of
http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.copy.html

Best
   Martin

>
> Thanks, Noam.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: retroactive branch?

Posted by Marc Haisenko <ha...@comdasys.com>.
On Wednesday 08 August 2007 13:43, Noam Tamim wrote:
> Hi,
> A user has started a big change. He didn't create his own branch first, so
> he's in the trunk. His work is still ongoing, but he needs to commit.
> However in the current state, a commit will break the trunk.
> 
> Is it possible to somehow retroactively branch his work, and later merge
> everything to the trunk?
> 
> Thanks, Noam.

I think you can do it something like this way:

# Create branch
svn cp -r $REV_WHERE_BIG_CHANGE_STARTED-1 $REPO/path $REPO/branchpath

# Check it out
svn co $REPO/branchpath

# Merge the big changes up to now
cd branchpath
svn merge $REPO/path -r $REV_WHERE_BIG_CHANGE_STARTED:HEAD
svn commit

# Switch working copy with uncommited changes to branch; the uncommitted 
# changes are not lost !
cd ../path
svn switch $REPO/branchpath

# Commit the changes in the branch; you can now do "svn up" in the working 
# copy for "branchpath"
svn commit

# Switch back to the "normal" branch
svn switch $REPO/path

# Now you have this: $REPO/path and $REPO/branchpath are the same, except that
# $REPO/branchpath now also contains the changes that were not committed
# because of fear of breakage. Now you can revert the stuff from the big 
# change in the main branch.
svn merge -r HEAD:$REV_WHERE_BIG_CHANGE_STARTED
svn commit

This all assumes that between $REV_WHERE_BIG_CHANGE_STARTED and HEAD only 
commits regarding the big change where done to $REPO/path (commits to other
branches are fine).

Take with care, this is just a quick shot and not tried out.
	Marc

-- 
Marc Haisenko
Comdasys AG

Rüdesheimer Straße 7
D-80686 München
Tel:   +49 (0)89 - 548 433 321
e-mail: haisenko@comdasys.com
http://www.comdasys.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: retroactive branch?

Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
On Wednesday 08 August 2007 13:43, Noam Tamim wrote:
> A user has started a big change. He didn't create his own branch first, so
> he's in the trunk. His work is still ongoing, but he needs to commit.
> However in the current state, a commit will break the trunk.
>
> Is it possible to somehow retroactively branch his work, and later merge
> everything to the trunk?

svn copy $URL/trunk $URL/branches/eksperimental
svn switch . $URL/branches/eksperimental

In other words, you first create a copy of whatever his working copy is based 
on (use a server-side copy for speed) and then switch the working copy to 
that branch. The switch will (try to) apply all changes between the two URLs 
to the working copy, which in this case are no changes at all. If you use 
TSVN, I think there is even a utility that allows you to create a branch from 
a working copy and switch the working copy to that branch.

BTW: even if he had already checked the whole thing into the trunk, you could 
simply branch it in its current, experimental state and then undo 
(reverse-merge) the changes. Switching to the WC remains the same, only 
merging becomes more complicated, because you must never merge the first 
change (the undo) of the trunk to the branch and you have to redo the 
experimental changes before merging the branch to the trunk.

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Ronald Boers, Amtsgericht Hamburg HR B62 932

**************************************************************************************
           Visit our website at <http://www.satorlaser.de/>
**************************************************************************************
Diese E-Mail einschließlich sämtlicher Anhänge ist nur für den Adressaten bestimmt und kann vertrauliche Informationen enthalten. Bitte benachrichtigen Sie den Absender umgehend, falls Sie nicht der beabsichtigte Empfänger sein sollten. Die E-Mail ist in diesem Fall zu löschen und darf weder gelesen, weitergeleitet, veröffentlicht oder anderweitig benutzt werden.
E-Mails können durch Dritte gelesen werden und Viren sowie nichtautorisierte Änderungen enthalten. Sator Laser GmbH ist für diese Folgen nicht verantwortlich.

**************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org