Branch DevelopmentThis is a featured page

As described in Parallel Development, we use branches in SVN to snapshot the code base that reflects the released version of the project. This allows new development to carry on in the TRUNK; while still allowing maintenance to the released version to occur in the branch.
As we find new bugs, we will decide if they need to be fixed in the branch. Those items that are deemed critical will be fixed in a special milestone. For example, current release is BETA-2, for hot fixes, we would create "Beta-2-1" as a new milestone/branch.
Branch Development Process
In short, you make your eclipse workspace be identical to BETA2.1 Branch. Do your fixes, check them into the branch. Then you decide if you want to promote the fix to the TRUNK or not (using the version control MERGE feature – include 'dry run' if needed). In general, most of the fixes also belong in the trunk.

Branch Development - Technical DebtBenefits of SVN Merge
Yes, you could copy the good file off to the side (or in your paste buffer), and then paste it into the branch file and commit. However, using the SVN merge feature is better because that sets the svn:mergeinfo metadata so that you can track the true history of a file. Copy/pasting does not do this.
Moving forward, developers may be required to change code in different branches other than the main /TRUNK/. If you need to do this, follow the process below to switch your project to the appropriate branch.
Branch Development - Technical DebtProject, Folder, File?
If you need to do extensive development in a branch that relies on deep compiles of code, do the whole project. Just a few stand-alone changes in a well-isolated area? Do the Folder. A simple tweak of a single file that is isolated? Just do the file...

Setting Up Your Workspace

Step 1 - Switch to Branch
Right click your project:
Branch Development - Technical Debt
and go to Team > Switch:
Branch Development - Technical Debt

Branch Development - Technical Debt

Step 2 - Select Branch
Click Browse to search the BRANCHES in the repository:
Branch Development - Technical Debt
Here we have selected BETA2.1 Branch: Branch Development - Technical Debt
Click OK
Branch Development - Technical Debt
Branch Development - Technical Debt

Step 3 - Verify Switch
You should see the branch name in your project:
Branch Development - Technical Debt
Branch Development - Technical Debt

Making Changes

Complete Your WorkBranch Development - Technical Debt
Commit to BranchBranch Development - Technical Debt
Compare to TrunkBranch Development - Technical Debt
See DiffBranch Development - Technical Debt
Your Changed FileRevision 9875
Branch Development - Technical Debt
LogAdd revision number/file in Jira comment -- especially important when we look to bring fixes into a branch.

Merging From Branch To Trunk

commit branchcommit your local changes to branch, including unversioned files
determine branch creationgo to your branch within SVN repository browser, right click, show log and select "stop on copy". scroll to the end (page if needed) to see the revision when the branch was copied
Branch Development - Technical Debt
switch to TRUNKSwitch your working copy from the branch back to TRUNK
Branch Development - Technical Debt
verify you are in TRUNK verify your working copy says you are in trunk
Branch Development - Technical Debt
merge BRANCH into working copymerge a range of revisions in the branch into the working copy. the merge dialog FROM should be the BRANCH url and the revision when the branch was created, so you don't go back to the start of time. the merge dialog TO is the same BRANCH url and would be the head revision, but you can specify an earlier revision in the branch.
Branch Development - Technical Debt
commit working to TRUNKmanually fix any merge conflicts, test locally, then commit your working to TRUNK

Merging From Trunk to Branch

This is most generally used for a file or two, though you could do it for an entire folder. Basically move to the Branch, then go to the file(s) you changed, and merge in the TRUNK changes.

NOTE: you don't have to merge just from the TRUNK, these instructions work if you want to merge from one branch to another. It is simply that we often need to know how to grab a change in the TRUNK and put it into the branch that we want to make a build from.

If you only need to merge one or two files, you can actually specify individual file locations in the from/to fields (rather than the top-level directory which would merge the entire tree). Merging single files can be safer because there could be other changes in the trunk that should not be merged.

Switch to BranchRight click your project:
Branch Development - Technical Debt
and go to Team > Switch:
Branch Development - Technical Debt
Branch Development - Technical Debt
Select BranchClick Browse to search the BRANCHES in the repository:
Branch Development - Technical Debt
Here we have selected BETA2.1 Branch:
Branch Development - Technical Debt
Click OK
Branch Development - Technical Debt
Branch Development - Technical Debt
Select MergeFrom the perspective of the file that needs to be updated (either via the navigator or the editor window), right-click to choose Merge:
Branch Development - Technical Debt
Click Browse to search the TRUNK in the repository for the file that you are replacing:
Branch Development - Technical Debt
Use the "Show Log" button to find the From and To revisions:
Branch Development - Technical Debt
Notice that I have selected revisions in both cases.
Branch Development - Technical Debt
Click OK
Commit the changesNow that you have just merged from the TRUNK to the BRANCH, you need to commit these changes to the BRANCH itself.




JonKern
JonKern
Latest page update: made by JonKern , Apr 8 2011, 11:46 AM EDT (about this update About This Update JonKern Edited by JonKern

13 words deleted

view changes

- complete history)
Keyword tags: agile development process
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)