8
edits
(→Notes) |
Ljcool2006 (talk | contribs) (svn servers have now been taken down) |
||
(20 intermediate revisions by 14 users not shown) | |||
Line 1: | Line 1: | ||
{{outdated}} | |||
[http://subversion.tigris.org/ Subversion] (SVN) is the version control system used on most of the Mozilla websites. The Mozilla repository is available at [http://svn.mozilla.org/ svn.mozilla.org]. There is also an alternative view which provides RSS feeds and other information at [http://viewvc.svn.mozilla.org/vc/ viewvc.svn.mozilla.org]. | |||
[http:// | |||
=Repository Structure= | =Repository Structure= | ||
Line 7: | Line 6: | ||
$project/trunk | $project/trunk | ||
$project/ | $project/branches/... | ||
$project/tags/... | |||
$project/ | |||
where | where | ||
Line 17: | Line 13: | ||
* <tt>$project</tt> is the project name (defined later) | * <tt>$project</tt> is the project name (defined later) | ||
* <tt>trunk</tt> is the "root branch"/trunk | * <tt>trunk</tt> is the "root branch"/trunk | ||
Remora/Addons3 is being developed in /addons; Mozilla Labs projects will go in labs/$projectName. | Remora/Addons3 is being developed in /addons; Mozilla Labs projects will go in labs/$projectName. | ||
Line 30: | Line 19: | ||
=How to get an account= | =How to get an account= | ||
File an IT ticket with your username on the | == SVN account for general access == | ||
File an IT ticket with your username on the SVN server and which project you’re working on. | |||
Follow the [https://www.mozilla.org/hacking/committer/ procedure to gain access to commit]. | |||
=How to connect= | =How to connect= | ||
==Mac== | |||
* Install Mac OSX Developer Tools (XCode) | |||
* use svn from the command line using command line arguments | |||
* if you want to use ssh, make sure your ssh key is installed in ~/.ssh | |||
Instructions coming soon for non-Developers. Mac OS Developer Tools comes with subversion, but a self-service system with instructions for Non-Developers is in the works. | |||
==Windows== | ==Windows== | ||
Get [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] and [http://tortoisesvn.net/ TortoiseSVN]. | Get [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] and [http://tortoisesvn.net/ TortoiseSVN]. | ||
* | *Don’t just download the PuTTY exe, use the installer package - it contains Pageant which you need and PuTTYgen which you may need to convert your SSH key. | ||
Fire up Pageant. Right click on the icon in your system tray and click "add key." browse too your private key and select it. | Fire up Pageant. Right click on the icon in your system tray and click "add key." browse too your private key and select it. | ||
Line 50: | Line 47: | ||
*Auto-login username = your email address | *Auto-login username = your email address | ||
Connection -> | Connection -> SSH -> Auth | ||
*Browse to your private key for authentication | *Browse to your private key for authentication | ||
Line 61: | Line 58: | ||
If you get that far, things are good, type exit and terminate the connection. | If you get that far, things are good, type exit and terminate the connection. | ||
TortoiseSVN -> settings -> Network. Make it an empty box where it asks you to specify the SSH client. | TortoiseSVN -> settings -> Network. Make it an empty box where it asks you to specify the SSH client. I’m not sure why I did this, but it works for me. | ||
SVN checkout from svn+ssh://nameofyourputtysession/addons/ | SVN checkout from svn+ssh://nameofyourputtysession/addons/ | ||
If this | (I think this needs to be: | ||
svn+ssh://nameofyourputtysession/projects/<your project> | |||
--[[User:Johnjbarton|Johnjbarton]] 12:03, 14 July 2008 (PDT)) | |||
If this doesn’t work, hop on IRC and we’ll see what we can do for you. If you work out more solutions, please add them to this page. | |||
==Linux== | ==Linux== | ||
[http://subversion.tigris.org/project_packages.html Install a package] that works for you. If | [http://subversion.tigris.org/project_packages.html Install a package] that works for you. If you’re on debian or ubuntu ‘apt-get install subversion’ will handle all this for you. | ||
* You could simply use your LDAP username/password to checkin/checkout to svn over https. If you'd rather use ssh, then the following entries in your ~/.ssh/config file will make life easy. Replace blah@domain.com with your e-mail address. | |||
<pre> | |||
~ $cat ~/.ssh/config | |||
Host svn.mozilla.org | |||
User blah@domain.com | |||
~ $ | |||
</pre> | |||
= How to Use SVN = | = How to Use SVN = | ||
Line 78: | Line 88: | ||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.checkout.html documentation]) | ([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.checkout.html documentation]) | ||
'''Usage: svn co | '''Usage: svn co ''source'' ''dest'' ''' | ||
SVN bases its repositories on URLs, so to check out code, you’ll need a URL. For example, to checkout the code for mozilla.com or mozilla.org anonymously you could type: | |||
''svn co http://svn.mozilla.org/projects/mozilla.com/trunk/ mozilla.com/'' <br> | |||
''svn co http://svn.mozilla.org/projects/mozilla.org/trunk/ mozilla.org/'' | |||
or if you have an account with an SSH key: | |||
''svn co | ''svn co svn+ssh://yourusername(see note below)@svn.mozilla.org/projects/mozilla.com/trunk/ mozilla.com/''<br> | ||
''svn co svn+ssh://yourusername(see note below)@svn.mozilla.org/projects/mozilla.org/trunk/ mozilla.org/'' | |||
Your username is usually your email address. In case you experience errors when using more than one ‘@’ sign in the repository URL, make sure you encode the @ sign in the email address as %40. | |||
or if you want to use https: | |||
''svn co https://svn.mozilla.org/projects/mozilla.com/trunk/ mozilla.com/''<br> | |||
''svn co https://svn.mozilla.org/projects/mozilla.org/trunk/ mozilla.org/'' | |||
You'll be prompted for your username and password. | |||
===commit (ci)=== | ===commit (ci)=== | ||
Line 96: | Line 113: | ||
'''Usage: svn commit [file [file...]]''' | '''Usage: svn commit [file [file...]]''' | ||
By checking out over ssh, you’ll be able to commit your changes. | |||
Once your code is checked out, you can commit your changes back to the repository. This command takes an optional list of files or directories to commit, if you only want to commit some changes. An example: | Once your code is checked out, you can commit your changes back to the repository. This command takes an optional list of files or directories to commit, if you only want to commit some changes. An example: | ||
Line 101: | Line 120: | ||
''svn commit'' | ''svn commit'' | ||
If | If you’d like to add a comment and commit all in one line, you can try this command: | ||
''svn commit -m "Commit message here"'' | ''svn commit -m "Commit message here"'' | ||
===diff=== | |||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.diff.html documentation]) | |||
'''Usage: svn diff [file [file...]] > patch''' | |||
If you do not have an account, you can still make a patch to submit in a bug. | |||
This command takes a list of files or directories. An example: | |||
''svn diff . > wholedir.patch'' | |||
===status=== | ===status=== | ||
Line 130: | Line 160: | ||
== Notes == | == Notes == | ||
This is a really brief overview, and if | This is a really brief overview, and if you’d like further reading, please check out the following: | ||
* [http://svnbook.red-bean.com/en/1.2/index.html The complete free | * [http://svnbook.red-bean.com/en/1.2/index.html The complete free O’reilly book] (filled with great examples) | ||
* [http://svnbook.red-bean.com/en/1.2/svn.forcvs.html A short appendix] from the book specifically for CVS users | * [http://svnbook.red-bean.com/en/1.2/svn.forcvs.html A short appendix] from the book specifically for CVS users | ||
* [http://svn.collab.net/repos/svn/trunk/doc/user/cvs-crossover-guide.html | Another great reference for CVS users] | * [http://svn.collab.net/repos/svn/trunk/doc/user/cvs-crossover-guide.html | Another great reference for CVS users] | ||
* [http://www.onlamp.com/pub/a/onlamp/2004/08/19/subversiontips.html ONLamp. | * [http://www.onlamp.com/pub/a/onlamp/2004/08/19/subversiontips.html ONLamp.com’s top tips] for CVS users | ||
As of April 2007, webdav is available over https. | As of April 2007, webdav is available over https. | ||
Line 142: | Line 172: | ||
[http://viewvc.svn.mozilla.org/vc/ Viewvc] can be quite useful for browsing sources and seeing changes. | [http://viewvc.svn.mozilla.org/vc/ Viewvc] can be quite useful for browsing sources and seeing changes. | ||
= See also = | |||
* [[Mercurial]], Mozilla's version control system for the source code of most of its software products. | |||
* [[Template:SVN]] to create a link to a version in Subversion |
edits