=======
release
=======

The release module provides a script to release an egg.

The steps are:

- running tests
- raising the version in setup.py
- building the changes
- creating a branch vor this version
- creating a tag
- uploading over cheeseshop
- sending a mail that list the changes

Let's set the curdir to the package we work on, because releaser uses
the current working directory to work::

    >>> import os
    >>> package_dir = os.path.join(test_dir, 'data', 'my.package')
    >>> os.chdir(package_dir)

Let's get the version::

    >>> import packet
    >>> packet.get_version()
    '0.1'

First step, let's check the tests passes::

    >>> packet.check_tests()
    True

Now that we are sure all tests passes, let's raise the version::

    >>> packet.raise_version('0.2')
    >>> packet.get_version()  
    '0.2'

Let's build CHANGES::

    >>> CHANGES = os.path.join(package_dir, 'CHANGES') 
    >>> print open(CHANGES).read()
    trunk (2008-10-12)
    ==================
    <BLANKLINE>
      - added the cool feature
    <BLANKLINE>
    0.1 (2008-10-10)
    ================
    <BLANKLINE>
      - initial version created by IngeniSkel
    <BLANKLINE>
    <BLANKLINE>

    >>> packet.increment_changes()
    >>> print open(CHANGES).read()
    trunk (2008-...)
    ==================
    <BLANKLINE>
      - xxx [Ingeniweb]
    <BLANKLINE>
    0.2 (2008-...)
    ================
    <BLANKLINE>
      - added the cool feature
    <BLANKLINE>
    0.1 (2008-10-10)
    ================
    <BLANKLINE>
      - initial version created by IngeniSkel
    <BLANKLINE>
    <BLANKLINE>

Now let's commiting the changes over subversion::

    >>> packet.create_branches()
    branch was existing, removed
    copied http://xxx/my.package/trunk to http://xxx/my.package/branches/0.2
    http://xxx/my.package/branches/0.2/setup.cfg removed
    branch was existing, removed
    copied http://xxx/my.package/branches/0.2 to http://xxx/my.package/tags/0.2

This creates a branch and a tag for the version.

