Commit 4781bf52 authored by Jelmer Vernooij's avatar Jelmer Vernooij

ignore build output.

parent 1ac0f9d8
build
*.pyc
test????.tmp
tags
apidocs
.plugins
FAQ.html
README.html
AUTHORS.html
Original author and maintainer:
Jelmer Vernooij <jelmer@samba.org>
Thanks to the following people for comments, code reviews, funding, bug
reports, testing, committing patches/bundles and generally keeping up
while I was asking annoying questions:
Windows support:
Mark Hammond
Adrian Wilkins
David Allouche
Erik Bgfors
Alexander Belchenko
Andrew Bennetts
Wouter Bolsterlee
Alexey Borzenkov
Andrew Cowie
Aaron Bentley
Max Bowser
John Carr
Jerry Carter
Chandler Carruth
Robert Collins
Mattias Eriksson
David Foerster
Mirko Friedenhagen
Martin von Gagern
Mac OS X support:
Guillermo Gonzalez
Mark Hammond
Wouter van Heyst
Michael Hudson
David James
Matthias Klose
Jan Kneschke
Luks Lalinsk
Kevin Light
Roland Mas
John Arbash Meinel
Stefan Metzmacher
Andrew Mitchell
Gustavo Niemeyer
Martin Pool
Garrett Rooney
Jean-Francois Roy
Johan Rydberg
Peter Samuelson
Mark Shuttleworth
Adeodato Sim
Mikhail Sobolev
John Stowers
Reinhard Tartler
Adrian Wilkins
Russel Winder
Name:
Paul Hummer
bzr-svn frequently asked questions
==================================
.. contents::
Trying to branch into repository gives an error about incompatibility.
----------------------------------------------------------------------
Creating a repository and then trying to clone a Subversion branch into
that repository may cause the following error:
::
bzr: ERROR: Repository KnitRepository is not compatible with repository SvnRepository
bzr-svn requires a repository format that supports recording root file ids. To
upgrade the repository, run:
::
$ bzr upgrade --rich-root-pack
Pushing a branch that didn't exist in Subversion yet with `bzr push` fails.
---------------------------------------------------------------------------
At the moment, only `bzr svn-push` can be used to push new branches into
Subversion. Future releases will include this functionality in `bzr push`.
More information can be found in the bug report at:
https://bugs.launchpad.net/bzr-svn/+bug/127945.
Cloning a large Subversion branch is very slow
----------------------------------------------
There is no way around this at the moment, because Bazaar has to import all
the history from the Subversion branch.
bzr-svn will work significantly faster against a Subversion 1.5 server, so if
you have control over the server it may be worthwhile to upgrade it.
Alternatively, you may want to just check out the tip of the Subversion branch
and access the earlier revisions only when necessary by using stacked branches,
e.g.::
$ bzr branch --stacked svn://svn.gnome.org/svn/gnome-specimen/trunk
The Bazaar revno's differ from the Subversion revno's
-----------------------------------------------------
That's right. Bazaar revision numbers are per-branch, whereas Subversion
revno's are per-repository. If you would like to use Subversion revision
numbers, use the "svn:" revision specifier. For example:
::
$ bzr ls -rsvn:34 svn://example.com/bar
bzr log will also show the Subversion revision number.
After upgrading bzr-svn, Bazaar reports branches have diverged while pulling, when they haven't
-----------------------------------------------------------------------------------------------
As of version 0.4, bzr-svn creates revisions with different revision ids than
previous versions. In other words, existing bzr-svn branches created with
0.3.x can not be used directly with 0.4.0 but will have to be upgraded to
work with 0.4.0 using the "bzr svn-upgrade" command. The bzr-rebase package
has to be installed for this command to work correctly.
Is it possible to keep the author name when pushing changes into Subversion?
----------------------------------------------------------------------------
Yes, but this requires the repository to allow revision property changes.
See hooks/pre-revprop-change in the Subversion repository for
more information about how to do this.
You also need to enable support for this in bzr-svn by setting
``override-svn-revprops`` in ~/.bazaar/bazaar.conf to a comma-separated
list of Subversion revision properties you would like to override.
For example::
override-svn-revprops = svn:log, svn:author
I converted my Subversion repository using svn-import, but now all branches are empty!
--------------------------------------------------------------------------------------
bzr-svn does not create working trees by default. If you need
the working trees, run "bzr checkout" in the branch or
specify --trees to svn-import.
bzr-svn did a replace operation on the branch I pushed to when I tried to push a merge commit to Subversion
-----------------------------------------------------------------------------------------------------------
Yes, this is because bzr-svn has to preserve the mainline history of your Bazaar
branch in Subversion.
If you would like to avoid this, use a checkout and merge into that ("bzr co")
or rebase on trunk rather than merging it.
For example::
$ bzr push ../trunk
bzr: ERROR: These branches have diverged. Try using "merge" and then "push".
$ bzr rebase ../trunk
All changes applied successfully.
...
$ bzr push ../trunk
All changes applied successfully.
Pushed up to revision 1075.
If you would like to forbid Bazaar from ever doing these replace operations, set the
``append_revisions_only`` setting to True for the repository you're
pushing to.
bzr-svn sets all kinds of file properties when pushing revisions into Subversion. Is this really necessary?
-----------------------------------------------------------------------------------------------------------
Yes, this is because bzr-svn pushes to Subversion while
retaining the exact same history that is in the Bazaar branch
you're pushing.
These properties are used for storing Bazaar metadata that
can not be losslessly mapped to existing Subversion metadata.
bzr-svn can and will use revision properties rather than file properties
if the Subversion server is running Subversion 1.5 or higher. These custom
revision properties don't show up in commit notifications or trac.
Alternatively, it is possible to push changes to Subversion without
setting that metadata by using the ``bzr dpush`` command.
Since revisions created in Subversion this way are actually (slightly)
different from the matching revisions in the local branch, it is necessary for
the dpush command to rebase your branch to the remote branch after pushing.
You would get a DivergedBranches error when pulling from a svn branch you have
just pushed to.
If you are using trac, you can get it to ignore these file properties by
setting the ``hide_properties`` setting in the browser section of your
configuration to a list of properties that should not be displayed by trac,
e.g.::
[browser]
hide_properties = svk:merge, bzr:file-ids, bzr:merge, bzr:revision-info
Is it possible to not use the on-disk cache?
--------------------------------------------
Yes, simply set ``use-cache = False`` for the repository in question in
~/.bazaar/subversion.conf. This will of course have some consequences for the
performance of bzr-svn since it will have to re-fetch data.
..
vim: ft=rest
Development
===========
Unit testing
~~~~~~~~~~~~
To run the bzr-svn testsuite, simply run
'bzr selftest --starting-with=bazaar.plugins.svn' or
run 'make check' in the top-level bzr-svn directory.
Coding Style, etc
~~~~~~~~~~~~~~~~~
Please refer to HACKING in the Bazaar source distribution.
Installation
------------
Requirements
~~~~~~~~~~~~
Bazaar
^^^^^^
You will need a recent version of Bazaar, usually the release of Bazaar
released in the same month as the release of bzr-svn you are using. bzr-svn
will warn if the Bazaar release used is too old or too new.
SQLite
^^^^^^
If you are using Python 2.4, you will need to have the pysqlite module
installed. Python 2.5 and higher have sqlite support built in.
Subversion development files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You need the Subversion libraries, including the development files. This should
be readily packaged for most platforms. The package name for Debian
and Debian-based distributions such as Ubuntu is ``libsvn-dev``.
bzr-rebase
^^^^^^^^^^
In order to be able to use the ``svn-upgrade`` command (for those
who used versions of bzr-svn older than 0.4.0), you will need the `bzr-rebase`_
plugin.
.. _bzr-rebase: http://bazaar-vcs.org/Rebase
Building
~~~~~~~~
Simply place this directory in ~/.bazaar/plugins and you should be able
to check out branches from Subversion using bzr. Make sure the directory
name is 'svn'. The plugin has to be built as well by running ``make``.
Packages
~~~~~~~~
Instead of installing the plugin yourself, you can also install a prepackaged
version of it for your platform.
Windows Setup
^^^^^^^^^^^^^
An unofficial bzr-svn installer for Win32 as well as an unofficial, patched build of Python-Subversion for Windows can be found at http://d5190871.u44.websitesource.net/bzr/. This package can be used with the Python-based installer or the standalone installation of Bazaar.
Debian/Ubuntu GNU/Linux
^^^^^^^^^^^^^^^^^^^^^^^
Debian/Ubuntu packages are available from `Jelmer's Debian repository`_.
.. _Jelmer's Debian repository: http://samba.org/~jelmer/debian/
Ubuntu's in-development release and Debian sid usually also contain the latest release.
GoboLinux
^^^^^^^^^
GoboLinux includes `a recipe <http://recipes.gobolinux.org/r/?list=BZR-SVN>`_ for bzr-svn.
OpenSuse Linux
^^^^^^^^^^^^^^
OpenSuse packages created by Michael Wolf are available from http://download.opensuse.org/repositories/home:/maw:/bzr/
Gentoo Linux
^^^^^^^^^^^^
An unofficial Gentoo overlay containing the patches for Subversion versions 1.3 and 1.4, plus a bzr-svn ebuild are hosted on launchpad at https://launchpad.net/bzr-gentoo-overlay/.
Mac OS X
^^^^^^^^
Download the latest Subversion DMG from: http://svnbinaries.open.collab.net/servlets/ProjectDocumentList
bzr-svn DMGs can be found on the bzr-svn download page on Launchpad.
bzr-svn is now also available in MacPorts, and can be installed with::
$ sudo port install bzr-svn
..
vim: ft=rest
# Simple Makefile for Bazaar plugin
# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
DEBUGGER ?=
BZR ?= $(shell which bzr)
BZR_OPTIONS ?=
PYTHON ?= $(shell which python)
SETUP ?= $(PYTHON) ./setup.py
PYDOCTOR ?= pydoctor
CTAGS ?= ctags
PYLINT ?= pylint
RST2HTML ?= $(if $(shell which rst2html.py 2>/dev/null), rst2html.py, rst2html)
TESTS ?=
DESTDIR ?=
REST_DOCS = README FAQ AUTHORS
all:: build build-inplace $(patsubst %,%.html,$(REST_DOCS))
build::
$(SETUP) build
build-inplace::
$(SETUP) build_ext --inplace
build-inplace-debug::
$(SETUP) build_ext --inplace --debug
install::
ifneq ($(DESTDIR),)
$(SETUP) install --root "$(DESTDIR)"
else
$(SETUP) install
endif
clean::
$(SETUP) clean
rm -f *.so
TMP_PLUGINS_DIR = $(shell pwd)/.plugins
$(TMP_PLUGINS_DIR):
mkdir -p $@
$(TMP_PLUGINS_DIR)/svn: $(TMP_PLUGINS_DIR)
ln -sf .. $@
check:: build-inplace $(TMP_PLUGINS_DIR)/svn
BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(DEBUGGER) $(PYTHON) $(PYTHON_OPTIONS) $(BZR) $(BZR_OPTIONS) selftest $(TEST_OPTIONS) --starting-with=bzrlib.plugins.svn $(TESTS)
check-verbose::
$(MAKE) check TEST_OPTIONS=-v
check-one::
$(MAKE) check TEST_OPTIONS=--one
check-random::
$(MAKE) check TEST_OPTIONS="--random=now --verbose --one"
valgrind-check:: build-inplace-debug
$(MAKE) check DEBUGGER="valgrind --suppressions=/usr/lib/valgrind/python.supp $(VALGRIND_OPTIONS)"
leak-check::
$(MAKE) valgrind-check VALGRIND_OPTIONS="--leak-check=full --show-reachable=yes --num-callers=200 --leak-resolution=med --log-file=leaks.log"
gdb-check:: build-inplace-debug
$(MAKE) check DEBUGGER="gdb --args $(GDB_OPTIONS)"
strace-check::
$(MAKE) check DEBUGGER="strace $(STRACE_OPTIONS)"
show-plugins::
BZR_PLUGIN_PATH=$(TMP_PLUGINS_DIR) $(BZR) plugins
lint::
$(PYLINT) -f parseable *.py */*.py
pydoctor::
$(PYDOCTOR) --make-html -c bzr-svn.cfg
FAQ.html README.html AUTHORS.html: %.html: %
$(RST2HTML) $< > $@
tags::
$(CTAGS) -R .
ctags:: tags
homepage.html: wiki.py README INSTALL
python wiki.py | tail -n +2 | rst2html > $@
This diff is collapsed.
Bazaar support for Subversion branches, working trees and repositories
======================================================================
.. contents::
Introduction
------------
bzr-svn is a plugin that allows Bazaar_ direct access to Subversion_
repositories. It allows most bzr commands to work directly against Subversion
repositories, as if you were using bzr with a native bzr repository.
.. _Bazaar: http://bazaar-vcs.org/
.. _Subversion: http://subversion.tigris.org/
The plugin can at the moment be used to commit to, pull from, merge from, push
to and view logs of Subversion branches from Bazaar.
Features
--------
The following features are currently present:
- Connecting to remote Subversion repositories over all
protocols supported by Subversion itself (at present:
svn://, svn+ssh://, http:// (webdav), file://)
as well as dump files.
Checkouts, lightweight checkouts and branching works.
- Integrates well with Bazaar.
- Track Bazaar merges in Subversion. Merged revisions show up
as ghosts.
- Subversion working copies. Can be modified, queried
(``bzr status`` on a svn- native working copy created with
``svn co`` works) and committed from.
- Committing to Subversion from Bazaar.
- Push Bazaar revisions to Subversion.
- Follow branch copies. Revision history is not
truncated when a branch was copied in Subversion.
- Efficiently uses network bandwidth.
- Recognizes file metadata (executable bits, symbolic links).
- 'svn-import' command with functionality similar to svn2bzr_.
.. _svn2bzr: http://bazaar-vcs.org/svn2bzr
- Ability to track merges done with SVK_ and write merges from SVK/Subversion
branches in a format understandable by SVK.
.. _SVK: http://svk.elixus.org/
- Writes svn:mergeinfo property used by Subversion 1.5.
- Generates consistent file ids and revision ids. Two branches made using
this plugin of the same Subversion branch will result in *exactly* the same
Bazaar branch.
- Handles complex operations in Subversion: committing to two branches at
once, upgrading directories to branches, copies from early revisions, ...
- Tested on Linux, Windows and Mac OS X.
Documentation
-------------
bzr-svn can be used through the regular Bazaar user interface, see the
`Bazaar Documentation Overview`_ for documentation on that.
.. _Bazaar Documentation Overview: Documentation
Some bzr-svn specific issues are answered by the FAQ_.
.. _FAQ: http://samba.org/~jelmer/bzr-svn/FAQ.html
The way Bazaar metadata is stored in Subversion and the other way around is
specified in the `mapping specification`_.
.. _mapping specification: BzrForeignBranches/Subversion/mapping
Limitations
-----------
Unsupported Subversion File Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some Subversion properties can currently not be represented in Bazaar and are
therefore ignored for the time being:
- 'svn:ignore'. There should be a `Repository.get_ignores(revid)` call in
Bazaar rather than a magic '.bzrignore' file.
Spec at https://launchpad.net/products/bzr/+spec/new-ignore-rules
- 'svn:mime-type'
- 'svn:eol-style'. Requires eol support in Bazaar.
- 'svn:keywords'. Requires keywords support in Bazaar. Spec at
https://launchpad.net/products/bzr/+spec/bzr-keyword-expansion.
`#81463 <https://bugs.launchpad.net/bzr-svn/+bug/81463>`_
- 'svn:externals'. Externals should be mapped to Bazaar 'by-reference'
nested branches and the other way around. This can't be implemented
until Bazaars nested branch support lands.
Future Enhancements
-------------------
In the future, I also hope to support:
- Renames. Initial work has been done to support this,
but the number of corner cases is wide, so support for this
has not been enabled by default yet.
- Override implementation of get_revision_delta(). Will speed up 'bzr log -v'
- use svn_ra_replay() when using servers that have Subversion 1.4. Saves a
couple of roundtrips when fetching history.
Some Subversion properties can currently not be represented in Bazaar
and are therefore ignored for the time being:
Other features currently held back by Bazaars feature set:
- Tracking copies.
Spec at https://launchpad.net/products/bzr/+spec/filecopies
- Showing SVN merges as merges in Bazaar. This requires full merge tracking
information in Subversion, something which the Subversion folks are working
on at the moment (see https://svn.collab.net/repos/svn/branches/merge-tracking).
Requires tracking cherry-picking support in Bazaar:
Spec at https://launchpad.net/products/bzr/+spec/bzr-cpick-data
Support
-------
Ask bzr-svn related questions on the `Bazaar mailing list`_ or in the
#bzr IRC channel on Freenode_.
.. _Bazaar mailing list: http://lists.canonical.com/listinfo/bazaar/
.. _Freenode: http://www.freenode.net/
Bugs
----
Please file bug reports in launchpad. The product URL for bzr-svn is
https://launchpad.net/bzr-svn/.
The wiki for this plugin is at http://bazaar-vcs.org/BzrForeignBranches/Subversion.
..
vim: ft=rest
mappingv4:
- implement layout functions, including command
- create schemes from layouts rather than the other way around
+ remove Mapping.get_guessed_layout()
- fix update_after_commit test
- fix text parents
- find tags during iter_all_changes() during fetch
more tests:
- Run all tests against repository with revprop changing allowed and without
- performance tests (count roundtrips?)
- bzr:hidden
- bzr svn-set-revprops
performance:
- generate deltas rather than fulltexts when creating file id maps
- use replay and replay range to fetch revisions
- implement SvnWorkingTree.apply_inventory_delta()
for other things to do, see:
* https://bugs.launchpad.net/bzr-svn
Upgrading from bzr-svn 0.4.x to 0.5.x
=====================================
If you'd like to keep using bzr-svn 0.4.x against your svn repo,
set "default-mapping = v3".
else:
If you have Subversion 1.5 and are admin, run bzr svn-set-revprops
Any commits made by you from this point on will not have any bzr-specific
metadata when retrieved by bzr-svn 0.4.x and vice-versa.
This diff is collapsed.
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Authentication token retrieval."""
from bzrlib.config import AuthenticationConfig
from bzrlib.trace import mutter
from bzrlib.ui import ui_factory
from bzrlib.plugins.svn.subvertpy import ra
import urlparse
import urllib
AUTH_PARAM_DEFAULT_USERNAME = 'svn:auth:username'
AUTH_PARAM_DEFAULT_PASSWORD = 'svn:auth:password'
SSL_NOTYETVALID = 0x00000001
SSL_EXPIRED = 0x00000002
SSL_CNMISMATCH = 0x00000004
SSL_UNKNOWNCA = 0x00000008
SSL_OTHER = 0x40000000
class SubversionAuthenticationConfig(AuthenticationConfig):
"""Simple extended version of AuthenticationConfig that can provide
the information Subversion requires.
"""
def __init__(self, scheme, host, port, path, file=None):
super(SubversionAuthenticationConfig, self).__init__(file)
self.scheme = scheme
self.host = host
self.port = port
self.path = path
def get_svn_username(self, realm, may_save):
"""Look up a Subversion user name in the Bazaar authentication cache.
:param realm: Authentication realm (optional)
:param may_save: Whether or not the username should be saved.
"""
mutter("Obtaining username for SVN connection")
username = self.get_user(self.scheme, host=self.host, path=self.path, realm=realm)
if username is None:
return None
return (username, False)
def get_svn_simple(self, realm, username, may_save):
"""Look up a Subversion user name+password combination in the Bazaar
authentication cache.
:param realm: Authentication realm (optional)
:param username: Username, if it is already known, or None.
:param may_save: Whether or not the username should be saved.
"""
mutter("Obtaining username and password for SVN connection")
username = self.get_user(self.scheme,
host=self.host, path=self.path, realm=realm) or username
password = self.get_password(self.scheme, host=self.host,
path=self.path, user=username,
realm=realm, prompt="%s %s password" % (realm, username))
return (username, password, False)
def get_svn_ssl_server_trust(self, realm, failures, cert_info, may_save):
"""Return a Subversion auth provider that verifies SSL server trust.
:param realm: Realm name (optional)
:param failures: Failures to check for (bit field, SVN_AUTH_SSL_*)
:param cert_info: Certificate information
:param may_save: Whether this information may be stored.
"""
mutter("Verifying SSL server: %s", realm)
credentials = self.get_credentials(self.scheme, host=self.host)
if (credentials is not None and
credentials.has_key("verify_certificates") and
credentials["verify_certificates"] == False):
accepted_failures = (
SSL_NOTYETVALID +
SSL_EXPIRED +
SSL_CNMISMATCH +
SSL_UNKNOWNCA +
SSL_OTHER)
else:
accepted_failures = 0
return (accepted_failures, False)
def get_svn_username_prompt_provider(self, retries):
"""Return a Subversion auth provider for retrieving the username, as
accepted by svn_auth_open().
:param retries: Number of allowed retries.
"""
return ra.get_username_prompt_provider(self.get_svn_username,
retries)
def get_svn_simple_prompt_provider(self, retries):
"""Return a Subversion auth provider for retrieving a
username+password combination, as accepted by svn_auth_open().
:param retries: Number of allowed retries.
"""
return ra.get_simple_prompt_provider(self.get_svn_simple, retries)