Difference between revisions of "Svn practices"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Read-only access)
(Working with branch)
Line 63: Line 63:
 
== Working with branch ==
 
== Working with branch ==
 
There at least two situations that you need work with branche.
 
There at least two situations that you need work with branche.
 +
Change you will made is complicated or you want to share it with others during development.
  
Know how to work with branch is also helpful even you don't get your own branch.
+
You may also need work with brache created by others. For example, after AOO 3.4 is released, a branch for AOO 3.4.1 was created.  
For example, after AOO 3.4 is released, a branch for AOO 3.4.1 was created.  
+
  
svn merge should be used if you get a fix need be submitted to both the 3.4.1 branch and main line.
+
Instead of doing 'svn commit' twice, 'svn merge' should be used if you get a fix need be submitted to both the 3.4.1 branch and main line.
  
*How to create a branche of your own. When it comes to big or complicated changes, you may don't want to commit in stable branch directly.  
+
There are also other cases in which you don't want to commit in development mainline directly.  
  
*How to merge your changes
+
*How to create a branche
 +
 
 +
 
 +
*How to merge change in brache back to mainline
  
 
==Reference==
 
==Reference==

Revision as of 09:06, 6 June 2012

This page is still in draft. This line will be removed after the page been reviewed.

This page gathered svn practices frequently used by contributors and committers. If you have any advice to this page, please feel free to update it or discuss your idea in ooo-dev mail list.

Read-only access

  • Grab the whole source code from main trunk

svn co https://svn.apache.org/repos/asf/incubator/ooo/trunk ooo

  • Grab a branche

svn co https://svn.apache.org/repos/asf/incubator/ooo/branches/AOO34/main/sw sw

This get the source code for writer module from AOO34 branche

  • Get the latest changes into your working copy

execute 'svn update' in working directory. It is ooo or sw for above cases.

This command will attempt to merge the public changes with the local changes if any.

  • Update to a specific revision

svn update -r xxxx

  • Check changes history

svn log
svn log -v
svn log -r m
svn log filename

  • Check changes & Create patch for specific revision

svn diff -r m:n > n.patch

Write access

  • Commit your changes

Change can be comitted in by svn commit -m "comment" However, this is not recommended. Since it is lack of information for contributors and may also cause unwanted changes.

  • Check changes before commit

svn status

  • Specify in the command line a list of the files/dirs that are changed to avoid accidentally committing unwanted changes.

svn commit change1 change2

  • Template for the log files should be used
  Patch by:
  Suggested by:
  Found by:
  Review by:

svn commit -F ../mychangelog.txt change1 change2

Update bugzilla with revision information for crossreference when you are done with the commit

Working with branch

There at least two situations that you need work with branche. Change you will made is complicated or you want to share it with others during development.

You may also need work with brache created by others. For example, after AOO 3.4 is released, a branch for AOO 3.4.1 was created.

Instead of doing 'svn commit' twice, 'svn merge' should be used if you get a fix need be submitted to both the 3.4.1 branch and main line.

There are also other cases in which you don't want to commit in development mainline directly.

  • How to create a branche


  • How to merge change in brache back to mainline

Reference

A guide for new committers: http://www.apache.org/dev/new-committers-guide.html

Merge Instruction from FreeBSD: http://wiki.freebsd.org/SubversionPrimer/Merging

SVN book: http://svnbook.red-bean.com/en/1.7/svn-book.html

Personal tools