Webtools:SVN Guidelines: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 22: Line 22:
** (Programmers should be developing and testing on their own branches, or /trunk/)
** (Programmers should be developing and testing on their own branches, or /trunk/)


= Tagging for Staging / Production =
= Tagging for Staging / Production using svn merge =
* Basic process is: check out production, merge your changes, commit production
* Basic process is: check out production, merge your changes, commit production
* Our example assumes:
* Our example assumes:
Line 35: Line 35:
* When you're '''SURE''' that the patches are correct/make sense, you need to commit it (substitute your rev # for 150):  
* When you're '''SURE''' that the patches are correct/make sense, you need to commit it (substitute your rev # for 150):  
  [clouserw@fattony /data/mozilla.com]$ svn commit -m "Merging revisions 100:150 /trunk/ into /tags/production/"
  [clouserw@fattony /data/mozilla.com]$ svn commit -m "Merging revisions 100:150 /trunk/ into /tags/production/"
* If possible, it helps to keep track of what your last merge revision was (or you will look it up next time you merge.  We throw it into the IRC channel topic just for reference.
= Tagging for Staging / Production using svn externals =
A downside of using merge is that you can create conflicts/inconsistencies when manually merging a subset of an atomic revision (just a couple files instead of the whole tree).
The alternative is to use [http://svnbook.red-bean.com/en/1.0/ch07s03.html svn externals].
The downside and/or "hacky" thing about using externals is that SVN requires a directory to check out a repo path as an external.  This makes it sub-optimal if you have lots of single files in your root directory.
Here is a list of steps to tag something using externals:
* Create your tag directory.  It has to exist before you set properties on it.
  [clouserw@fattony /data/mozilla.com]$ svn mkdir svn+ssh://svn.mozilla.org/projects/mozilla.com/tags/newtag
* Update or check out this tag.
  [clouserw@fattony /data/mozilla.com]$ svn up
or
  [clouserw@fattony /data/]$ svn co svn+ssh://svn.mozilla.org/projects/mozilla.com/tags/newtag mozilla.com
* Edit your tag properties to change which externals are pulled when it is checked out and updated.
  [clouserw@fattony /data/mozilla.com]$ svn propedit svn:externals .
* This will open your CLI editor (vim/emacs/pico -- whatever you have set in your .subversion/config dir under "editor-cmd") and you can edit which items get pulled.  We will use the en-US directory as an example.
en-US -r3491 https://svn.mozilla.org/projects/mozilla.com/trunk/en-US/
* This tells SVN, "when I check out the 'newtag' tag, newtag/en-US will pull https://svn.mozilla.org/projects/mozilla.com/trunk/en-US/, revision 3491".
* At any time if you would want to find out what externals your tag has, you can use this:
svn propget svn:externals https://svn.mozilla.org/mozilla.com/tags/newtag
* Note that mozilla.com is a bad example because it has files floating in the root dir -- README and index.html can't be checked out as externals.  So it may not be a good fit for you depending on how your files are laid out.  For AMO, however, it fits a bit better because the root directory of the tag just has a simple README with a link to the wiki and two directories that can be easily set up to be externals.


= When to push =
= When to push =
3,035

edits

Navigation menu