Contributing to Breezy
======================

Talk to us
----------

If you want to fix or improve something in Breezy, we want to help you.
You can ask at any time for help, on the list, on irc, or through a pull
request on GitHub.

* `Bazaar mailing list <https://lists.ubuntu.com/mailman/listinfo/bazaar>`_

* `Breezy mailing list <https://groups.google.com/g/breezy-vcs>`_

* IRC in channel ``#breezy`` on ``irc.oftc.net``


Starting
--------

Before starting on a change it's a good idea to either file a bug, find a
relevant existing bug, or send a proposal to the list.  If there is a bug
you should set it to "In Progress" and if you wish assign it to yourself.

You might like to start with a bug tagged `easy
<https://bugs.launchpad.net/brz/+bugs?field.tag=easy>`_.

If you are wondering if your understanding of the bug is correct, or if the 
approach you have in mind is likely to work, feel to ask about it on the bug,
in ``#breezy`` or on the mailing list.

Making a branch
---------------

First, get a local copy of Breezy::

   $ cd $HOME
   $ bzr branch https://github.com/breezy-team/breezy.git brz
   $ cd brz

Now make your own branch; we recommend you include the bug number and also
a brief description::

   $ brz switch -b brz.dev 123456-status-speed

and go ahead and commit in there.  Normally you should fix only one bug or
closely-related cluster of bugs per branch, to make reviews and merges
flow more smoothly.

Publishing your changes
-----------------------

After you've locally committed your changes, the configuration above
should be enough that you can push them to GitHub with a simple ::

    $ brz publish


Writing tests
-------------

We value test coverage and generally all changes should have or update a
test.  There is a powerful test framework but it can be hard to find the
right place to put your test.  Don't hesitate to ask, or to propose a
merge that does not yet have tests.

Normally for command-line code you should look in
``breezy.tests.blackbox`` and for library code in ``breezy.tests``.  For
functions on an interface for which there are multiple implementations,
like `Transport`, look in ``breezy.tests.per_transport``.

It's a good idea to search the tests for something related to the thing
you're changing and you may find a test you can modify or adapt.

To run the tests::

    $ ./brz selftest

Normally the tests will skip if some library dependencies are not present.
On Ubuntu, you can install them with this command (you must have source
repositories enabled in Software Sources)::

    $ sudo apt-get build-dep brz

To build the binary extensions::

    $ make

For more information: `Testing Guide <testing.html>`_.


Proposing a merge
-----------------


Then propose a merge into Breezy; for Breezy 3.0 and later you can use the ``brz
propose`` command.  In the comment for your merge proposal please
explain what you're trying to do and why.  For `example
<https://code.launchpad.net/~ian-clatworthy/bzr/whats-new-in-2.1/+merge/19677>`_:

  As discussed on the mailing list, this patch adds a What's New document
  summarising the changes since 2.0.

If you make additional changes to your branch you don't need to resubmit;
they'll automatically show up in the merge proposal.

..
   vim: ft=rst tw=74 ai
