Skip to content

Svn2git #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
4 commits merged into from
Feb 22, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove svn references, or change to git
  • Loading branch information
ddale committed Feb 21, 2011
commit 914a43aade5c6607b5c00f573e13c7f39e71fa23
86 changes: 0 additions & 86 deletions MIGRATION.txt

This file was deleted.

3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ build_osx105:


jdh_doc_snapshot:
svn up;\
git pull;\
python setup.py install --prefix=~/dev;\
cd doc;\
rm -rf build;\
python make.py clean;\
svn up;\
python make.py html latex sf sfpdf;


Expand Down
4 changes: 2 additions & 2 deletions doc/_templates/indexsidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h3>News</h3>
pathto('users/installing') }}">installing</a>
</p>

<p>Sandro Tosi has a new book
<p>Sandro Tosi has a new book
<a href="http://www.packtpub.com/matplotlib-python-development/book?utm_source=matplotlib.sourceforge.net&utm_medium=link&utm_content=pod&utm_campaign=mdb_002124">Matplotlib for python
developers</a>
also
Expand Down Expand Up @@ -64,7 +64,7 @@ <h3>Need help?</h3>
but it is a good idea to ping us on the mailing list too.</p>

<p>For details on what's new, see the detailed <a href="{{
pathto('_static/CHANGELOG', 1) }}">changelog</a> or browse the <a href="http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/">source code</a>. Anything that could
pathto('_static/CHANGELOG', 1) }}">changelog</a> or browse the <a href="https://github.com/matplotlib/matplotlib.git">source code</a>. Anything that could
require changes to your existing codes is logged in the <a href="{{
pathto('api/api_changes.html', 1) }}">api changes</a> file.</p>

Expand Down
253 changes: 1 addition & 252 deletions doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,6 @@
Coding guide
************

.. _version-control:

Version control
===============

.. _using-svn:

svn checkouts
-------------

Checking out everything in the trunk (matplotlib and toolkits)::

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk \
matplotlib --username=youruser --password=yourpass

Checking out the main source::

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\
matplotlib mpl --username=youruser --password=yourpass

Branch checkouts, eg the 1.0.x maintenance branch::

svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
v1_0_maint mpl1 --username=youruser --password=yourpass



Committing changes
------------------

Expand Down Expand Up @@ -60,231 +33,7 @@ in mind.
:file:`MANIFEST.in`. This file determines what goes into the source
distribution of the mpl build.

* Keep the maintenance branch (0.91) the latest release branch (eg
0.98.4) and trunk in sync where it makes sense. If there is a bug
on both that needs fixing, use `svnmerge.py
<http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to keep them in
sync. See :ref:`svn-merge` below.

.. _svn-merge:

Using svnmerge
--------------

svnmerge is useful for making bugfixes to a maintenance branch, and
then bringing those changes into the trunk.

The basic procedure is:

* install ``svnmerge.py`` in your PATH::

> wget http://svn.apache.org/repos/asf/subversion/trunk/contrib/\
client-side/svnmerge/svnmerge.py

* get a svn checkout of the branch you'll be making bugfixes to and
the trunk (see above)

* Create and commit the bugfix on the branch.

* Then make sure you svn upped on the trunk and have no local
modifications, and then from your checkout of the svn trunk do::

svnmerge.py merge -S BRANCHNAME

Where BRANCHNAME is the name of the branch to merge *from*,
e.g. v1_0_maint.

If you wish to merge only specific revisions (in an unusual
situation), do::

> svnmerge.py merge -rNNN1-NNN2

where the ``NNN`` are the revision numbers. Ranges are also
acceptable.

The merge may have found some conflicts (code that must be manually
resolved). Correct those conflicts, build matplotlib and test your
choices. If you have resolved any conflicts, you can let svn clean
up the conflict files for you::

> svn -R resolved .

``svnmerge.py`` automatically creates a file containing the commit
messages, so you are ready to make the commit::

> svn commit -F svnmerge-commit-message.txt


.. _setting-up-svnmerge:

Setting up svnmerge
~~~~~~~~~~~~~~~~~~~

.. note::
The following applies only to release managers when there is
a new release. Most developers will not have to concern themselves
with this.

* Creating a new branch from the trunk (if the release version is
1.0 at revision 8503)::

> svn copy \
https://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib@8503 \
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint \
-m "Creating maintenance branch for 1.0"

* You can add a new branch for the trunk to "track" using
"svnmerge.py init", e.g., from a working copy of the trunk::

> svnmerge.py init https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint
property 'svnmerge-integrated' set on '.'

After doing a "svn commit" on this, this merge tracking is available
to everyone, so there's no need for anyone else to do the "svnmerge
init".

* Tracking can later be removed with the "svnmerge.py uninit" command,
e.g.::

> svnmerge.py -S v1_0_maint uninit

.. _using-git:

Using git
---------

Some matplotlib developers are experimenting with using git on top of
the subversion repository. Developers are not required to use git, as
subversion will remain the canonical central repository for the
foreseeable future.

Cloning the git mirror
~~~~~~~~~~~~~~~~~~~~~~

There is an experimental `matplotlib github mirror`_ of the subversion
repository. To make a local clone of it in the directory ``matplotlib``,
enter the following commands::

# Download the entire git repository into "matplotlib", name the source repository "svn".
git clone --origin svn git@github.com:astraw/matplotlib.git

# Change into the newly created git repository.
cd matplotlib

# Setup the subversion mirroring.
git svn init --trunk=trunk/matplotlib --prefix=svn/ https://matplotlib.svn.sourceforge.net/svnroot/matplotlib

# Tell git svn to analyze the subversion history
git svn rebase -l

.. _matplotlib github mirror: http://github.com/astraw/matplotlib

To install from this cloned repository, use the commands in the
:ref:`svn installation <install-svn>` section::

> cd matplotlib
> python setup.py install

Note that it is not possible to interact with the matplotlib
maintenance branches through git due to different representations of
source code repositories in svnmerge and git.

An example git workflow
~~~~~~~~~~~~~~~~~~~~~~~

The following is a suggested workflow for git/git-svn.

Start with a virgin tree in sync with the svn trunk on the git branch
"trunk"::

git checkout trunk
git svn rebase

To create a new, local branch called "whizbang-branch"::

git checkout -b whizbang-branch

Do make commits to the local branch::

# hack on a bunch of files
git add bunch of files
git commit -m "modified a bunch of files"
# repeat this as necessary

Now, go back to the trunk branch and append the history of your branch
to the git trunk branch, which will end up as the svn trunk::

git checkout trunk
git svn rebase # Ensure we have most recent svn
git rebase whizbang-branch # Append whizbang changes to trunk branch
git svn dcommit -n # Check that this will apply to svn
git svn dcommit # Actually apply to svn

Finally, you may want to continue working on your whizbang-branch, so
rebase it to the new trunk::

git checkout whizbang-branch
git rebase trunk

How was this git mirror set up?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These are notes for those interested in mirroring a subversion
repository on github. I pieced this together by lots of
trial-and-error.

Step 1: Create a local mirror of the svn repository

::

rsync -avzP rsync://matplotlib.svn.sourceforge.net/svn/matplotlib/ matplotlib-svn-rsync/

Step 2: Import the svn history into a new git repository

::

#!/bin/bash
set -e

TARGET=mpl.git.fixed
GIT=/home/astraw/git/bin/git
TRUNKBRANCH=trunk
SVNBRANCHPREFIX="svn/"

rm -rf $TARGET
mkdir $TARGET
cd $TARGET

$GIT init
$GIT svn init --rewrite-root=https://matplotlib.svn.sourceforge.net/svnroot/matplotlib \
--trunk=trunk/matplotlib --prefix=$SVNBRANCHPREFIX file:///mnt/workdisk/tmp/matplotlib-svn-rsync
$GIT svn fetch

# now, make master branch track ${SVNBRANCHPREFIX}trunk
$GIT checkout master -b tmp
$GIT branch -d master
$GIT checkout ${SVNBRANCHPREFIX}trunk -b $TRUNKBRANCH
$GIT branch -D tmp
$GIT svn rebase -l

Step 3: Upload the git repository to github

::

#!/bin/bash
set -e

TARGET=mpl.git.fixed
GIT=/home/astraw/git/bin/git
TRUNKBRANCH=trunk
SVNBRANCHPREFIX="svn/"

cd $TARGET

$GIT remote add github git@github.com:astraw/matplotlib.git
git push github $TRUNKBRANCH:master

.. _style-guide:
* Keep the maintenance branches and trunk in sync where it makes sense.

Style guide
===========
Expand Down
Loading