[Halld-offline] putting changes on a branch after the fact (revised, ignore the previous)
Mark M. Ito
marki at jlab.org
Fri Jul 11 14:46:00 EDT 2014
Paul and Richard,
Recall we talked about you two working on a common branch. The
difficulty was that Richard has already checked out the trunk and has
been making changes on to that "working copy". To do the
work-on-a-branch thing, we need to put those changes onto a branch that
does not exist at present. I am assuming that none of the modifications
to the working have been checked back in. If they have been checked in
that complicates matters and the following will not work in detail.
Here is the procedure for switching Richard's changes onto a branch.
1) Create the branch
1a) Determine the revision where Richard first checked out from the
trunk. Let us call that revision 10000.
1b) Create the branch with an svn copy. call it sim-recon-rj-pm for this
example. This is repository-to-repository copy, i. e., nothing changes
on the local disk.
svn copy https://halldsvn.jlab.org/repos/trunk/sim-recon@10000
https://halldsvn.jlab.org/repos/branches/sim-recon-rj-pm
Now we have a branch that is exactly the same as the trunk at the point
before Richard made changes. In particular, it does not contain any
changes made to the trunk after Richard did his checkout.
2) "Switch" Richard's changes onto the branch
2a) Backup the working copy, for obvious reasons.
2b) From within the sim-recon directory of the working copy execute a
switch:
svn switch https://halldsvn.jlab.org/repos/branches/sim-recon-rj-pm
Now the working copy thinks that it was originally checked out from the
branch. So any check-ins will not go to the trunk, but onto the branch.
Others, i. e., Paul, can check out the branch, get those changes and
continue working.
3) Merge back onto the trunk.
This is for the future, when work on the branch is complete and we want
to put all the changes back on the trunk. The rub is that we also want
to preserve any changes made to the trunk since revision 10000 as well.
3a) Check out an up-to-date version of the trunk
svn co https://halldsvn.jlab.org/repos/trunk/sim-recon
3b) Do the merge
cd sim-recon
svn merge https://halldsvn.jlab.org/repos/branches/sim-recon-rj-pm
Now the current directory contains all of the changes made on the branch
(because of the merge) and all changes made on the trunk since branching
(since we checked this copy out from the up-to-date trunk). The changes
made on the branch will be in the working copy, but none of them will
have been checked in. If there are conflicts then life gets interesting.
4) Check in the merged version. From the same directory (sim-recon).
svn checkin
And you are all done!
I tested this now on a junk directory of files that I keep around for
times like these.
All of this having being said, I am not fully convinced we want to go
this way. What do you guys think?
-- Mark
--
Mark M. Ito, Jefferson Lab, marki at jlab.org, (757)269-5295
_______________________________________________
Halld-offline mailing list
Halld-offline at jlab.org
https://mailman.jlab.org/mailman/listinfo/halld-offline
More information about the Halld-offline
mailing list