view README @ 331:75f082b5897e

Switch to using url scheme wrappers instead of duplicating each command we wrap. The 'hg svn url' command has been killed; the replacement is '.hg/hgrc'. More stuff related to its disappearance has been stripped, including two tests. HgChangeReceiver now takes a UUID argument, which it uses to ensure that remote repositories remain unchanged. This is a temporary solution, and I'm not entirely satisfied with how it's done either. Access to the UUID file has been isolated in a HgChangeReceiver property. Some more tests have been updated to use ui.pushbuffer()/popbuffer(), and to pass through the Mercurial API. Moved the arguments to wrappers.pull() to the UI configuration. Also, remove HgChangeReceiver.opts in favour of a 'usebranchnames' instance & configuration variable. The name is taken from the ConvertExtension.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 15 May 2009 19:18:43 +0200
parents 982c46e7d167
children dbdcb97b38af
line wrap: on
line source

.. -*-restructuredtext-*-

============
hgsubversion
============

hgsubversion is an extension for Mercurial that allows using Mercurial
as a Subversion client.

Right now it is *not* ready for production use. You should only be
using this if you're ready to hack on it, and go diving into the
internals of Mercurial and/or Subversion.

Installation
------------
You need to have Subversion installed with the SWIG Python bindings
from Subversion 1.5 or later. You need Mercurial 1.3 (currently in development)
or later.

.. _mercurial: http://selenic.com/repo/hg
.. _mercurial-stable: http://selenic.com/repo/hg-stable
.. _crew: http://hg.intevation.org/mercurial/crew
.. _crew-stable: http://hg.intevation.org/mercurial/crew-stable

If you are unfamiliar with installing Mercurial extensions, please see
the UsingExtensions_ page in the Mercurial wiki. Look at the example
for specifying an absolute path near the bottom of the page. You want
to give the path to the top level of your clone of this repository.

.. _UsingExtensions: http://www.selenic.com/mercurial/wiki/index.cgi/
                     UsingExtensions

Before using hgsubversion, I *strongly* encourage you to run the
automated tests. Just use nose_ if you have it (or ``easy_install
nose`` if you want it), or use ``python tests/run.py`` to run the
suite with the conventional test runner. Note that because I use nose,
there's a lot of stdout spew in the tests right now. The important
part is that all the tests pass.

.. _nose: http://code.google.com/p/python-nose/

Basic Use
-----------
Get a new clone of an svn server::

 $ hg clone <svn URI> [destination]

Real example::

 $ hg clone svn+http://python-nose.googlecode.com/svn nose-hg

Note, you should pull from the root subversion directory, not specific
folders (such as trunk). Also, you only need to modify http:// urls as shown.
This is a side effect of Mercurial and Subversion both claiming the http
protocol, so svn+http is used to work around that.

Pull new revisions into an already-converted repo::

 $ hg pull

For more information, see ``hg help svn`` while in a converted repo.

Support for ``svn:externals``
-----------------------------
All ``svn:externals`` properties are serialized into a single
``.hgsvnexternals`` file, with the following syntax::

  [.]
   external_reference_line1_1
   external_reference_line1_2
  [dir2]
   external_reference_line2_1
   external_reference_line2_2

A header line gives the directory the property applies on, '.' for the
project root directory. The property content follows, *every line
being prefixed by a single space*.

The creation or modification of this file will trigger ``svn:externals``
updates on the related subversion repository.