
Installing subversion for PyPy
==============================

Jens-Uwe Mager has prepared some installation files which should
help you to install subversion on your computer.

+ Download Unix source tarball or prepackaged versions_ for MacOS, Windows, FreeBSD and Linux

+ Additional information for Windows users:

  *  See Microsoft website_ if you have .DLL issues.

  *  Windows Installer file for Tortoise SVN (like Tortoise CVS) GUI_
     (Pick the UNICODE version for Windows 2000 and XP and
     see Win_ 2000, NT if you have problems loading it.)

+ Local copy of MacOS_ X binary tar ball
  (This requires at least OS X 10.3)

+ Debian instructions below...

Getting started
-----------------

If you're just getting started with subversion, here's a simple how-to.
For complete information, you can go read the subversion guide_.

**Download and install the appropriate installation file of subversion above.**

For linux:

download the tarball.  unzip and untar it.  Then type *./configure*.  Then, as root, *make* followed by *make install*.  Voila ... a subversion client.

For Debian users::

  $ apt-get install subversion-tools

People using Debian *stable* first need to add the following line to ``/etc/apt/sources.list`` (thanks backports_!)::

  deb http://fs.cs.fhm.edu/mirror/backports.org/debian stable subversion

Note that you can always go look at the files online_ with your browser, located at: http://codespeak.net/svn/pypy/dist
But, you'll want to check out your own local copies to work on.

Check out and Check in
----------------------------

There are currently two directories you'll want to check out: /src and /doc
In order to get the sourcecode and docs downloaded onto your drive, open a shell or commandline and type::

  $ svn co http://codespeak.net/svn/pypy/dist
  $ svn co http://codespeak.net/svn/pypy/extradoc

If you are behind a dump proxy this may or may not work; see below.

Once you've got the files checked out to your own system, you can use your favorite text editor to change to files. Be sure to read the coding-guide_ and other documentation files before doing a lot of work on the source code. Before doing any work, make sure you're using the most recent update with::

  $ svn up

this will update whichever subdirectory you're in (doc or src).

When you're ready to **check in** a file,

cd to your local checked out sourcecode directory, and if necessary, copy the file over from wherever you worked on it::

 $ cp ~/mydir/filename.ext filename.ext

If you're adding a brand-new file::

  $ svn add filename.ext

Then, to **commit** it::

 $ svn ci -m "your comments about what changes your committing"
 $ your password: (this may not be necessary)

You'll see something like the following::

 Adding         goals/stringcomp.py
 Transmitting file data .
 Committed revision 578.

or::

 Sending        coding-guide.txt
 Transmitting file data .
 Committed revision 631.

Check online on the `svn-commit archives`_ and you'll see your revision. Feel free to add a documentation file on any major changes you've made!

.. _`svn-commit archives`: http://codespeak.net/pipermail/pypy-svn/

Some other useful subversion tricks:
--------------------------------------

**Be sure to remember ``svn`` in the commandline in the following commands.**

``$ svn mv filename.ext``
    to move or rename a file

``$ svn rm filename.ext``
    to remove (delete) a file

``$ svn status``
    will let you know what changes you've made compared to the current repository version

``$ svn revert filename.ext``
    will fix problems if you deleted or moved a file without telling svn.

``$ svn cleanup``
    last resort to fix it if you've got a totally messed up local copy.
    Use this if you see error messages about ``locked`` files that you can't fix otherwise.

Circumventing proxies
----------------------------

Some proxies don't let extended HTTP commands through.  If you have an
error complaining about a bad request, you should use https: instead of
http: in the subversion URL. This will make use of SSL encryption, which
cannot be intercepted by proxies.

Alternatively, if you want to change your proxy configuration, see the
subversion FAQ: http://subversion.tigris.org/faq.html#proxy

How to Avoid Line-ending Hell
-----------------------------

We will assume that whenever you create a .txt or a .py file, you would
like other people to be able to read it with the line endings their
OS prefers, even if that is different from the one your OS likes.  This
could occasionally be wrong -- say when you are specifically testing
that code you are writing handles line endings properly -- but this is
what you want by default.  Binary files, on the other hand, should be
stored exactly as is. This has to be set on every client. Here is how:

In your home directory edit .subversion/config and comment in ::

   [miscellany]
   enable-auto-props = yes

   [auto-props]
   *.txt = svn:eol-style=native
   *.py  = svn:eol-style=native


.. _website: http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B259403
.. _GUI: http://tortoisesvn.tigris.org/servlets/ProjectDocumentList?folderID=616
.. _MacOS: http://codespeak.net/~jum/svn-1.4.0-darwin-ppc.tar.gz
.. _versions: http://subversion.tigris.org/project_packages.html
.. _Win: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=4B6140F9-2D36-4977-8FA1-6F8A0F5DCA8F
.. _guide: http://svnbook.red-bean.com/book.html#svn-ch-1
.. _backports: http://www.backports.org
.. _online: http://codespeak.net/svn/pypy/dist/
.. _coding-guide: coding-guide.html
