/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/HACKING.txt

Merge bzr.dev and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
down the track do not break new features or bug fixes that you are
251
251
contributing today.
252
252
 
253
 
As of May 2007, Bazaar ships with a test suite containing over 6000 tests
 
253
As of May 2008, Bazaar ships with a test suite containing over 12000 tests
254
254
and growing. We are proud of it and want to remain so. As community
255
255
members, we all benefit from it. Would you trust version control on
256
256
your project to a product *without* a test suite like Bazaar has?
283
283
This option can be combined with other selftest options (like -x) and
284
284
filter patterns to understand their effect.
285
285
 
 
286
Once you understand how to create a list of tests, you can use the --load-list
 
287
option to run only a restricted set of tests that you kept in a file, one test
 
288
id by line. Keep in mind that this will never be sufficient to validate your
 
289
modifications, you still need to run the full test suite for that, but using it
 
290
can help in some cases (like running only the failed tests for some time)::
 
291
 
 
292
  ./bzr selftest -- load-list my_failing_tests
 
293
 
 
294
This option can also be combined with other selftest options, including
 
295
patterns. It has some drawbacks though, the list can become out of date pretty
 
296
quick when doing Test Driven Development.
 
297
 
 
298
To address this concern, there is another way to run a restricted set of tests:
 
299
the --starting-with option will run only the tests whose name starts with the
 
300
specified string. It will also avoid loading the other tests and as a
 
301
consequence starts running your tests quicker::
 
302
 
 
303
  ./bzr selftest --starting-with bzrlib.blackbox
 
304
 
 
305
This option can be combined with all the other selftest options including
 
306
--load-list. The later is rarely used but allows to run a subset of a list of
 
307
failing tests for example.
 
308
 
 
309
Test suite debug flags
 
310
----------------------
 
311
 
 
312
Similar to the global ``-Dfoo`` debug options, bzr selftest accepts
 
313
``-E=foo`` debug flags.  These flags are:
 
314
 
 
315
:allow_debug: do *not* clear the global debug flags when running a test.
 
316
  This can provide useful logging to help debug test failures when used
 
317
  with e.g. ``bzr -Dhpss selftest -E=allow_debug``
 
318
 
286
319
 
287
320
Writing Tests
288
321
=============
617
650
the form of URL components.
618
651
 
619
652
 
620
 
Core Topics
621
 
###########
622
 
 
623
 
Evolving Interfaces
624
 
===================
625
 
 
626
 
We have a commitment to 6 months API stability - any supported symbol in a
627
 
release of bzr MUST NOT be altered in any way that would result in
628
 
breaking existing code that uses it. That means that method names,
629
 
parameter ordering, parameter names, variable and attribute names etc must
630
 
not be changed without leaving a 'deprecated forwarder' behind. This even
631
 
applies to modules and classes.
632
 
 
633
 
If you wish to change the behaviour of a supported API in an incompatible
634
 
way, you need to change its name as well. For instance, if I add an optional keyword
635
 
parameter to branch.commit - that's fine. On the other hand, if I add a
636
 
keyword parameter to branch.commit which is a *required* transaction
637
 
object, I should rename the API - i.e. to 'branch.commit_transaction'. 
638
 
 
639
 
When renaming such supported API's, be sure to leave a deprecated_method (or
640
 
_function or ...) behind which forwards to the new API. See the
641
 
bzrlib.symbol_versioning module for decorators that take care of the
642
 
details for you - such as updating the docstring, and issuing a warning
643
 
when the old api is used.
644
 
 
645
 
For unsupported API's, it does not hurt to follow this discipline, but it's
646
 
not required. Minimally though, please try to rename things so that
647
 
callers will at least get an AttributeError rather than weird results.
648
 
 
649
 
 
650
 
Deprecation decorators
651
 
----------------------
652
 
 
653
 
``bzrlib.symbol_versioning`` provides decorators that can be attached to
654
 
methods, functions, and other interfaces to indicate that they should no
655
 
longer be used.
656
 
 
657
 
To deprecate a static method you must call ``deprecated_function``
658
 
(**not** method), after the staticmethod call::
659
 
 
660
 
    @staticmethod
661
 
    @deprecated_function(zero_ninetyone)
662
 
    def create_repository(base, shared=False, format=None):
663
 
 
664
 
When you deprecate an API, you should not just delete its tests, because
665
 
then we might introduce bugs in them.  If the API is still present at all,
666
 
it should still work.  The basic approach is to use
667
 
``TestCase.applyDeprecated`` which in one step checks that the API gives
668
 
the expected deprecation message, and also returns the real result from
669
 
the method, so that tests can keep running.
670
 
 
671
653
Coding Style Guidelines
672
 
=======================
 
654
#######################
673
655
 
674
 
General Python rules
675
 
--------------------
 
656
hasattr and getattr
 
657
===================
676
658
 
677
659
``hasattr`` should not be used because it swallows exceptions including
678
660
``KeyboardInterrupt``.  Instead, say something like ::
681
663
 
682
664
 
683
665
Code layout
684
 
-----------
 
666
===========
685
667
 
686
668
Please write PEP-8__ compliant code.  
687
669
 
770
752
 
771
753
 
772
754
Module Imports
773
 
--------------
 
755
==============
774
756
 
775
757
* Imports should be done at the top-level of the file, unless there is
776
758
  a strong reason to have them lazily loaded when a particular
782
764
 
783
765
 
784
766
Naming
785
 
------
 
767
======
786
768
 
787
769
Functions, methods or members that are "private" to bzrlib are given
788
770
a leading underscore prefix.  Names without a leading underscore are
805
787
 
806
788
 
807
789
Standard Names
808
 
--------------
 
790
==============
809
791
 
810
792
``revision_id`` not ``rev_id`` or ``revid``
811
793
 
814
796
 
815
797
 
816
798
Destructors
817
 
-----------
 
799
===========
818
800
 
819
801
Python destructors (``__del__``) work differently to those of other
820
802
languages.  In particular, bear in mind that destructors may be called
822
804
later time, or possibly never at all.  Therefore we have restrictions on
823
805
what can be done inside them.
824
806
 
825
 
 0. Never use a __del__ method without asking Martin/Robert first.
 
807
 0. If you think you need to use a ``__del__`` method ask another
 
808
    developer for alternatives.  If you do need to use one, explain
 
809
    why in a comment.
826
810
 
827
811
 1. Never rely on a ``__del__`` method running.  If there is code that
828
812
    must run, do it from a ``finally`` block instead.
836
820
 
837
821
 
838
822
Factories
839
 
---------
 
823
=========
840
824
 
841
825
In some places we have variables which point to callables that construct
842
826
new instances.  That is to say, they can be used a lot like class objects,
851
835
 
852
836
 
853
837
Registries
854
 
----------
 
838
==========
855
839
 
856
840
Several places in Bazaar use (or will use) a registry, which is a 
857
841
mapping from names to objects or classes.  The registry allows for 
860
844
 
861
845
 
862
846
Lazy Imports
863
 
------------
 
847
============
864
848
 
865
849
To make startup time faster, we use the ``bzrlib.lazy_import`` module to
866
850
delay importing modules until they are actually used. ``lazy_import`` uses
890
874
the variable is a module, and these object should be hidden anyway, since
891
875
they shouldn't be imported into other namespaces.
892
876
 
893
 
 
894
 
Modules versus Members
895
 
~~~~~~~~~~~~~~~~~~~~~~
896
 
 
897
877
While it is possible for ``lazy_import()`` to import members of a module
898
878
when using the ``from module import member`` syntax, it is recommended to
899
879
only use that syntax to load sub modules ``from module import submodule``.
910
890
This will incorrectly fail, because ``MyClass`` is a ``ImportReplacer``
911
891
object, rather than the real class.
912
892
 
913
 
 
914
 
Passing to Other Variables
915
 
~~~~~~~~~~~~~~~~~~~~~~~~~~
916
 
 
917
893
It also is incorrect to assign ``ImportReplacer`` objects to other variables.
918
894
Because the replacer only knows about the original name, it is unable to
919
895
replace other variables. The ``ImportReplacer`` class will raise an
923
899
 
924
900
 
925
901
The Null revision
926
 
-----------------
 
902
=================
927
903
 
928
904
The null revision is the ancestor of all revisions.  Its revno is 0, its
929
905
revision-id is ``null:``, and its tree is the empty tree.  When referring
932
908
being phased out.
933
909
 
934
910
 
 
911
Object string representations
 
912
=============================
 
913
 
 
914
Python prints objects using their ``__repr__`` method when they are
 
915
written to logs, exception tracebacks, or the debugger.  We want
 
916
objects to have useful representations to help in determining what went
 
917
wrong.
 
918
 
 
919
If you add a new class you should generally add a ``__repr__`` method
 
920
unless there is an adequate method in a parent class.  There should be a
 
921
test for the repr.  
 
922
 
 
923
Representations should typically look like Python constructor syntax, but
 
924
they don't need to include every value in the object and they don't need
 
925
to be able to actually execute.  They're to be read by humans, not
 
926
machines.  Don't hardcode the classname in the format, so that we get the
 
927
correct value if the method is inherited by a subclass.  If you're
 
928
printing attributes of the object, including strings, you should normally
 
929
use ``%r`` syntax (to call their repr in turn).
 
930
 
 
931
Try to avoid the representation becoming more than one or two lines long.
 
932
(But balance this against including useful information, and simplicity of
 
933
implementation.)
 
934
 
 
935
Because repr methods are often called when something has already gone
 
936
wrong, they should be written more defensively than most code.  The object
 
937
may be half-initialized or in some other way in an illegal state.  The
 
938
repr method shouldn't raise an exception, or it may hide the (probably
 
939
more useful) underlying exception.
 
940
 
 
941
Example::
 
942
 
 
943
    def __repr__(self):
 
944
        try:
 
945
            return '%s(%r)' % (self.__class__.__name__,
 
946
                               self._transport)
 
947
        except:
 
948
            return 'FooObject(**unprintable**)'
 
949
 
 
950
 
 
951
Core Topics
 
952
###########
 
953
 
 
954
Evolving Interfaces
 
955
===================
 
956
 
 
957
We have a commitment to 6 months API stability - any supported symbol in a
 
958
release of bzr MUST NOT be altered in any way that would result in
 
959
breaking existing code that uses it. That means that method names,
 
960
parameter ordering, parameter names, variable and attribute names etc must
 
961
not be changed without leaving a 'deprecated forwarder' behind. This even
 
962
applies to modules and classes.
 
963
 
 
964
If you wish to change the behaviour of a supported API in an incompatible
 
965
way, you need to change its name as well. For instance, if I add an optional keyword
 
966
parameter to branch.commit - that's fine. On the other hand, if I add a
 
967
keyword parameter to branch.commit which is a *required* transaction
 
968
object, I should rename the API - i.e. to 'branch.commit_transaction'. 
 
969
 
 
970
When renaming such supported API's, be sure to leave a deprecated_method (or
 
971
_function or ...) behind which forwards to the new API. See the
 
972
bzrlib.symbol_versioning module for decorators that take care of the
 
973
details for you - such as updating the docstring, and issuing a warning
 
974
when the old api is used.
 
975
 
 
976
For unsupported API's, it does not hurt to follow this discipline, but it's
 
977
not required. Minimally though, please try to rename things so that
 
978
callers will at least get an AttributeError rather than weird results.
 
979
 
 
980
 
 
981
Deprecation decorators
 
982
----------------------
 
983
 
 
984
``bzrlib.symbol_versioning`` provides decorators that can be attached to
 
985
methods, functions, and other interfaces to indicate that they should no
 
986
longer be used.  For example::
 
987
 
 
988
   @deprecated_method(deprecated_in((0, 1, 4)))
 
989
   def foo(self):
 
990
        return self._new_foo()
 
991
 
 
992
To deprecate a static method you must call ``deprecated_function``
 
993
(**not** method), after the staticmethod call::
 
994
 
 
995
    @staticmethod
 
996
    @deprecated_function(deprecated_in((0, 1, 4)))
 
997
    def create_repository(base, shared=False, format=None):
 
998
 
 
999
When you deprecate an API, you should not just delete its tests, because
 
1000
then we might introduce bugs in them.  If the API is still present at all,
 
1001
it should still work.  The basic approach is to use
 
1002
``TestCase.applyDeprecated`` which in one step checks that the API gives
 
1003
the expected deprecation message, and also returns the real result from
 
1004
the method, so that tests can keep running.
 
1005
 
 
1006
Deprecation warnings will be suppressed for final releases, but not for
 
1007
development versions or release candidates, or when running ``bzr
 
1008
selftest``. This gives developers information about whether their code is
 
1009
using deprecated functions, but avoids confusing users about things they
 
1010
can't fix.
 
1011
 
 
1012
 
935
1013
Getting Input
936
1014
=============
937
1015
 
1174
1252
final fullstop.  If long, they may contain newlines to break the text.
1175
1253
 
1176
1254
 
 
1255
Assertions
 
1256
==========
 
1257
 
 
1258
Do not use the Python ``assert`` statement, either in tests or elsewhere.
 
1259
A source test checks that it is not used.  It is ok to explicitly raise
 
1260
AssertionError.
 
1261
 
 
1262
Rationale:
 
1263
 
 
1264
 * It makes the behaviour vary depending on whether bzr is run with -O
 
1265
   or not, therefore giving a chance for bugs that occur in one case or
 
1266
   the other, several of which have already occurred: assertions with
 
1267
   side effects, code which can't continue unless the assertion passes,
 
1268
   cases where we should give the user a proper message rather than an
 
1269
   assertion failure.
 
1270
 * It's not that much shorter than an explicit if/raise.
 
1271
 * It tends to lead to fuzzy thinking about whether the check is
 
1272
   actually needed or not, and whether it's an internal error or not
 
1273
 * It tends to cause look-before-you-leap patterns.
 
1274
 * It's unsafe if the check is needed to protect the integrity of the
 
1275
   user's data.
 
1276
 * It tends to give poor messages since the developer can get by with
 
1277
   no explanatory text at all.
 
1278
 * We can't rely on people always running with -O in normal use, so we
 
1279
   can't use it for tests that are actually expensive.
 
1280
 * Expensive checks that help developers are better turned on from the
 
1281
   test suite or a -D flag.
 
1282
 * If used instead of ``self.assert*()`` in tests it makes them falsely pass with -O.
 
1283
 
 
1284
 
1177
1285
Documenting Changes
1178
1286
===================
1179
1287
 
1755
1863
.. note::
1756
1864
  As well as prioritizing bugs and nominating them against a
1757
1865
  target milestone, Launchpad lets core developers offer to mentor others in
1758
 
  fixing them. Nice.
1759
 
 
1760
 
 
1761
 
Managing a Release
1762
 
==================
1763
 
 
1764
 
Starting a Release
1765
 
------------------
1766
 
 
1767
 
To start a new release cycle:
1768
 
 
1769
 
#. Send mail to the list with the key dates, who will be the release
1770
 
   manager, and the main themes or targetted bugs.  Ask people to nominate
1771
 
   objectives, or point out an high-risk things that are best done early,
1772
 
   or that interact with other changes.
1773
 
 
1774
 
#. Add a new "series" in Launchpad at <https://launchpad.net/bzr/+addseries>.  There is one 
1775
 
   series for every *x.y* release.
1776
 
 
1777
 
Weekly Status Updates
1778
 
---------------------
1779
 
 
1780
 
TODO: Things to cover:
1781
 
 
1782
 
* Early communication to downstream teams (e.g. Launchpad) about changes in dependencies.
1783
 
* Reminder re lifecycle and where we're up to right now
1784
 
* Summary of recent successes and pending work
1785
 
* Reminder re release objectives
1786
 
* Reminder re things needing attention, e.g. bug triage, reviews, testing of certain things, etc.
1787
 
 
1788
 
 
1789
 
Feature Freeze
1790
 
--------------
1791
 
 
1792
 
TODO: Get material from http://bazaar-vcs.org/FeatureFreeze.
1793
 
 
1794
 
 
1795
 
 
1796
 
Making a Release or Release Candidate
1797
 
-------------------------------------
1798
 
 
1799
 
.. Was previously at http://bazaar-vcs.org/ReleaseChecklist
1800
 
 
1801
 
.. TODO: Still needs more clarity on what's in a RC versus a final
1802
 
.. release?
1803
 
 
1804
 
.. TODO: Too much of this is manual but could be automated...
1805
 
 
1806
 
This is the procedure for making a new bzr release:
1807
 
 
1808
 
#. If the release is the first candidate, make a new branch in PQM. (Contact RobertCollins for this step).
1809
 
 
1810
 
   Register the branch at https://launchpad.net/products/bzr/+addbranch
1811
 
 
1812
 
#. Run the automatic test suite and any non-automated tests.  (For example, try a download over http; these should eventually be scripted though not automatically run.). Try to have all optional dependencies installed so that there are no tests skipped. Also make sure that you have the c extensions compiled (``make`` or ``python setup.py build_ext -i``).
1813
 
 
1814
 
#. In the release branch, update  ``version_info`` in ``./bzrlib/__init__.py``
1815
 
 
1816
 
#. Add the date and release number to ``./NEWS``.
1817
 
 
1818
 
#. Update the release number in the README. (It's not there as of 0.15, but please check).
1819
 
 
1820
 
#. Commit these changes to the release branch, using a command like::
1821
 
    
1822
 
     bzr commit -m "(jam) Release 0.12rc1." 
1823
 
   
1824
 
   The diff before you commit will be something like::
1825
 
 
1826
 
       === modified file 'NEWS'
1827
 
       --- NEWS        2006-10-23 13:11:17 +0000
1828
 
       +++ NEWS        2006-10-23 22:50:50 +0000
1829
 
       @@ -1,4 +1,4 @@
1830
 
       -IN DEVELOPMENT
1831
 
       +bzr 0.12rc1  2006-10-23
1832
 
 
1833
 
          IMPROVEMENTS:
1834
 
 
1835
 
 
1836
 
       === modified file 'bzrlib/__init__.py'
1837
 
       --- bzrlib/__init__.py  2006-10-16 01:47:43 +0000
1838
 
       +++ bzrlib/__init__.py  2006-10-23 22:49:46 +0000
1839
 
       @@ -35,7 +35,7 @@
1840
 
        # Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
1841
 
        # releaselevel of 'dev' for unreleased under-development code.
1842
 
 
1843
 
       -version_info = (0, 12, 0, 'dev', 0)
1844
 
       +version_info = (0, 12, 0, 'candidate', 1)
1845
 
 
1846
 
        if version_info[3] == 'final':
1847
 
            version_string = '%d.%d.%d' % version_info[:3]
1848
 
 
1849
 
#. Send the changes to PQM, to update the official master branch.
1850
 
 
1851
 
#. When PQM succeeds, pull down the master release branch.
1852
 
 
1853
 
#. Merge the release branch back into the trunk.  Check that changes in NEWS were merged into the right sections.  If it's not already done, advance the version number in bzr and bzrlib/__init__.py Submit this back into pqm for bzr.dev.
1854
 
 
1855
 
#. Make a distribution directory by running e.g. ``bzr export /tmp/bzr-<version>/`` in the working directory.
1856
 
 
1857
 
#. Run make in /tmp/bzr-<version>. This creates the extensions from the pyrex source.
1858
 
 
1859
 
#. Run the test suite in the distribution directory
1860
 
 
1861
 
#. Run ``setup.py install`` --root=prefix to do a test install into your system directory, home directory, or some other prefix.  Check the install worked and that the installed version is usable. (run the bzr script from the installed path with PYTHONPATH set to the site-packages directory it created). i.e. ::
1862
 
 
1863
 
    python setup.py install --root=installed
1864
 
    PYTHONPATH=installed/usr/lib/python2.4/site-packages installed/usr/bin/bzr
1865
 
 
1866
 
#. Clean the tree to get rid of .pyc files etc: make clean && rm -rf build && rm bzrlib/_*.c bzrlib/_*.so
1867
 
 
1868
 
#. Generate the reference documentation in text format: make doc/en/user-reference/bzr_man.txt.
1869
 
 
1870
 
#. Change back to your original branch and then run: make clean && make to create the compiled pyrex extensions.  You then need to copy the .c files over to the exported directory. 
1871
 
   
1872
 
   ``find . -name "*.c"`` will tell you which files you need.
1873
 
 
1874
 
#. Create the release tarball::
1875
 
   
1876
 
     cd /tmp && tar czf bzr-<version>.tar.gz bzr-<version>
1877
 
 
1878
 
#. Sign the tarball with e.g. ``gpg --detach-sign -a bzr-0.10rc1.tar.gz``
1879
 
 
1880
 
 
1881
 
Publishing the release
1882
 
----------------------
1883
 
 
1884
 
Now you have the releasable product.  The next step is making it
1885
 
available to the world.
1886
 
 
1887
 
#. In <https://launchpad.net/bzr/> click the "Release series" for this
1888
 
   series, to take you to e.g. <https://launchpad.net/bzr/1.1>.  Then
1889
 
   click "Register a release", and add information about this release.
1890
 
 
1891
 
#. Within that release, upload the source tarball and the GPG signature.
1892
 
 
1893
 
   (These used to also be uploaded to 
1894
 
   <sftp://escudero.ubuntu.com/srv/bazaar.canonical.com/www/releases/src>
1895
 
   but that's not accessible to all developers, and gets some mime types
1896
 
   wrong...)
1897
 
 
1898
 
#. Link from http://bazaar-vcs.org/Download to the tarball and signature.
1899
 
 
1900
 
#. Update http://doc.bazaar-vcs.org/ to have a directory of documentation
1901
 
   for this release.  (Controlled by the ``update-bzr-docs`` script on
1902
 
   escudero, and also update the ``latest`` symlink in
1903
 
   ``/srv/bazaar.canonical.com/doc/``.)
1904
 
 
1905
 
#. Announce on the `Bazaar home page`__
1906
 
   
1907
 
 __ http://bazaar-vcs.org/
1908
 
 
1909
 
 
1910
 
Announcing the release
1911
 
----------------------
1912
 
 
1913
 
Now that the release is publicly available, tell people about it.
1914
 
 
1915
 
#. Announce to ``bazaar-announce`` and ``bazaar`` mailing lists. 
1916
 
   The announce mail will look something like this:
1917
 
   
1918
 
    | Subject: bzr 0.11 release candidate 1
1919
 
    | 
1920
 
    | INTRO HERE. Mention the release number and date, and why the release. (i.e. release candidate for testing, final release of a version, backport/bugfix etc).
1921
 
    | 
1922
 
    | Tarballs:
1923
 
    | http://bazaar-vcs.org/releases/src/bzr-VERSION.tar.gz
1924
 
    | and GPG signature:
1925
 
    | http://bazaar-vcs.org/releases/src/bzr-VERSION.tar.gz.sig
1926
 
    | 
1927
 
    | DESCRIBE-CHANGES-IN-OVERVIEW-HERE
1928
 
    | 
1929
 
    | DESCRIBE-when the next release will be (if there is another - i.e. this is a release candidate)
1930
 
    | 
1931
 
    | Many thanks to all the contributors to this release! I've included the
1932
 
    | contents of NEWS for VERSION below:
1933
 
 
1934
 
   To generate the data from NEWS, just copy and paste the relevant news section and clean it up as appropriate. The main clean-up task is to confirm that all major changes are indeed covered. This can be done by running ``bzr log`` back to the point when the branch was opened and cross checking the changes against the NEWS entries.
1935
 
 
1936
 
   (RC announcements should remind plugin maintainers to update their plugins.)
1937
 
 
1938
 
     * For point releases (i.e. a release candidate, or an incremental fix to a released version) take everything in the relevant NEWS secion : for 0.11rc2 take everything in NEWS from the bzr 0.11rc2 line to the bzr 0.11rc1 line further down.
1939
 
 
1940
 
     * For major releases (i.e. 0.11, 0.12 etc), take all the combined NEWS sections from within that version: for 0.11 take all of the 0.11 specific section, plus 0.11rc2, plus 0.11rc1 etc.
1941
 
 
1942
 
#. Update the `news side menu`__ -- this currently requires downloading the file, editing it, deleting it, and uploading a replacement.
1943
 
 
1944
 
   __ http://bazaar-vcs.org/site/menu?action=AttachFile&do=view&target=news.html
1945
 
 
1946
 
#. Update the IRC channel topic. Use the ``/topic`` command to do this, ensuring the new topic text keeps the project name, web site link, etc.
1947
 
 
1948
 
#. Announce on http://freshmeat.net/projects/bzr/
1949
 
   
1950
 
   This should be done for both release candidates and final releases. If you do not have a Freshmeat account yet, ask one of the existing admins.
1951
 
 
1952
 
#. Update http://en.wikipedia.org/wiki/Bzr -- this should be done for final releases but not Release Candidates.
1953
 
 
1954
 
#. Package maintainers should update packages when they see the
1955
 
   announcement.
1956
 
 
1957
 
#. Blog about it.
1958
 
 
1959
 
#. Post to http://mail.python.org/mailman/listinfo/python-announce-list for major releases
1960
 
 
1961
 
#. Update the python package index: <http://pypi.python.org/pypi/bzr> - best
1962
 
   done by running ::
1963
 
 
1964
 
       python setup.py register
1965
 
 
1966
 
   Remember to check the results afterwards.
1967
 
 
1968
 
 
1969
 
Making Win32 installers
1970
 
-----------------------
1971
 
 
1972
 
**XXX:** This information is now probably obsolete, as Alexander uploads
1973
 
direct to Launchpad.  --mbp 20080116
1974
 
 
1975
 
Alexander Belchenko has been very good about getting packaged installers compiled (see Win32ReleaseChecklist for details). He generally e-mails John Arbash Meinel when they are ready. This is just a brief checklist of what needs to be done.
1976
 
 
1977
 
#. Download and verify the sha1 sums and gpg signatures. Frequently the sha1 files are in dos mode, and need to be converted to unix mode (strip off the trailing ``\r``) before they veryify correctly.
1978
 
 
1979
 
#. Upload to the Launchpad page for this release.
1980
 
 
1981
 
#. Upload to escudero (to the b.c.c/www/releases/win32 directory) using sftp, lftp or rsync
1982
 
 
1983
 
#. Cat the contents of the .sha1 files into the SHA1SUM.
1984
 
 
1985
 
#. Update the SHA1SUM and MD5SUM files using something like ``md5sum bzr-0.14.0.win32.exe >> MD5SUM``. Make sure you use append (>>) rather than overwrite (>).
1986
 
 
1987
 
#. Verify once again that everything is correct with ``sha1sum -c SHA1SUM`` and ``md5sum -c MD5SUM``.
1988
 
 
1989
 
#. Update ``.htaccess`` so that the 'bzr-latest.win32.exe' links point to the latest release. This is not done for candidate releases, only for final releases. (example: bzr-0.14.0, but not bzr-0.14.0rc1).
1990
 
 
1991
 
#. Make sure these urls work as expected:
1992
 
 
1993
 
   http://bazaar-vcs.org/releases/win32/bzr-latest.win32-py2.5.exe
1994
 
 
1995
 
   http://bazaar-vcs.org/releases/win32/bzr-latest.win32-py2.5.exe.asc
1996
 
 
1997
 
   http://bazaar-vcs.org/releases/win32/bzr-latest.win32-py2.4.exe
1998
 
 
1999
 
   http://bazaar-vcs.org/releases/win32/bzr-latest.win32-py2.4.exe.asc
2000
 
 
2001
 
   http://bazaar-vcs.org/releases/win32/bzr-setup-latest.exe
2002
 
 
2003
 
   http://bazaar-vcs.org/releases/win32/bzr-setup-latest.exe.asc
2004
 
   
2005
 
They should all try to download a file with the correct version number.
2006
 
 
2007
 
#. Update http://bazaar-vcs.org/Download to indicate the newly available versions.
2008
 
 
2009
 
#. Update http://bazaar-vcs.org/WindowsDownloads to have the correct version number as well as the correct sha1sum displayed.
2010
 
 
2011
 
 
2012
 
The Bazaar PPA archive
2013
 
----------------------
2014
 
 
2015
 
We build Ubuntu ``.deb`` packages for Bazaar as an important part of the release
2016
 
process.  These packages are hosted in a `Personal Package Archive (PPA)`__ on
2017
 
Launchpad, at <https://launchpad.net/~bzr/+archive>.
2018
 
 
2019
 
  __ https://help.launchpad.net/PPAQuickStart
2020
 
 
2021
 
We build packages for every supported Ubuntu release
2022
 
<https://wiki.ubuntu.com/Releases>.  Packages need no longer be updated
2023
 
when the release passes end-of-life because all users should have then
2024
 
update.
2025
 
 
2026
 
The ``debian/`` directory containing the packaging information is kept in
2027
 
branches on Launchpad, named like 
2028
 
<https://code.launchpad.net/~bzr/bzrtools/packaging-dapper>
2029
 
 
2030
 
Updating the PPA for a new release
2031
 
----------------------------------
2032
 
 
2033
 
Preconditions for building these packages:
2034
 
  
2035
 
 * You must have a Launchpad account and be a member of the `~bzr`__ team
2036
 
   
2037
 
 __ https://edge.launchpad.net/~bzr/+members>
2038
 
 
2039
 
 * You must have a GPG key registered to your Launchpad account.
2040
 
 
2041
 
 * Configure ``dput`` to upload to our PPA with this section in your
2042
 
   ``~/.dput.cf``::
2043
 
 
2044
 
        [bzr-ppa]
2045
 
        fqdn = ppa.launchpad.net
2046
 
        method = ftp
2047
 
        incoming = ~bzr/ubuntu
2048
 
        login = anonymous
2049
 
        allow_unsigned_uploads = 0
2050
 
 
2051
 
 * You need a Ubuntu (or probably Debian) machine, and ::
2052
 
 
2053
 
     sudo apt-get install build-essential devscripts dput
2054
 
 
2055
 
Here is the process; there are some steps which should be automated in
2056
 
future:
2057
 
 
2058
 
#. You will need a working directory for each supported release, such as
2059
 
   ``~/bzr/Packaging/dapper``
2060
 
 
2061
 
#. Download the official tarball of the release to e.g. ``~/bzr/Releases``
2062
 
 
2063
 
#. Copy the original tarball into your per-disto directory, then untar it 
2064
 
   and if necessary rename it::
2065
 
 
2066
 
     cp -l ~/bzr/Releases/bzrtools-1.3.0.tar.gz bzrtools_1.3.0.orig.tar.gz
2067
 
     tar xfvz bzrtools_1.3.0.orig.tar.gz
2068
 
     mv bzrtools bzrtools-1.3.0
2069
 
 
2070
 
#. Change into that directory and check out the packaging branch::
2071
 
 
2072
 
     cd bzrtools
2073
 
     bzr checkout \
2074
 
       bzr+ssh://bazaar.launchpad.net/~bzr/bzrtools/packaging-dapper \
2075
 
       debian
2076
 
 
2077
 
#. For Bazaar plugins, change the ``debian/control`` file to express a
2078
 
   dependency on the correct version of ``bzr``.
2079
 
 
2080
 
   For bzrtools this is typically::
2081
 
 
2082
 
      Build-Depends-Indep: bzr (>= 1.3~), rsync
2083
 
      Depends: ${python:Depends}, bzr (>= 1.3~), bzr (<< 1.4~), patch
2084
 
 
2085
 
#. Make a new ``debian/changelog`` entry for the new release,
2086
 
   either by using ``dch`` or just editing the file::
2087
 
 
2088
 
     dch -v '1.3.0-1~bazaar1~dapper1' -D dapper
2089
 
 
2090
 
   dch will default to the distro you're working in and this isn't checked
2091
 
   against the version number (which is just our conversion).  So make
2092
 
   sure to specify it.
2093
 
 
2094
 
   Make sure you have the correct email address for yourself, version
2095
 
   number, and distribution.  It should look something like this::
2096
 
 
2097
 
     >  bzrtools (1.3.0-1~bazaar1~dapper1) dapper; urgency=low
2098
 
     >
2099
 
     >   * New upstream release.
2100
 
     >
2101
 
     >  -- John Sample <sample@example.com>  Mon, 31 Mar 2008 12:36:27 +1100
2102
 
 
2103
 
   If you need to upload the package again to fix a problem, normally you
2104
 
   should increment the last number in the version number, following the
2105
 
   distro name.  Make sure not to omit the initial ``-1``, and make sure
2106
 
   that the distro name in the version is consistent with the target name
2107
 
   outside the parenthesis.
2108
 
 
2109
 
#. Commit these changes into the packaging branch::
2110
 
 
2111
 
     bzr ci -m '1.3.0-1~bazaar1~dapper1: New upstream release.' debian
2112
 
 
2113
 
#. Build a source package::
2114
 
 
2115
 
     debuild -S -sa -i
2116
 
 
2117
 
   This will create a ``.changes`` file in the per-distro directory,
2118
 
   and should invoke gpg to sign it with your key.
2119
 
   Check that file is reasonable: it should be uploading to the intended
2120
 
   distribution, have a .orig file included, and the right version number.
2121
 
 
2122
 
#. Upload into the PPA::
2123
 
 
2124
 
     dput bzr-ppa ../bzrtools__1.3.0-1\~bazaar1\~dapper1_source.changes
2125
 
 
2126
 
   Don't forget the ``bzr-ppa`` component or dput will try to upload into
2127
 
   the main archive by default.  You can disable this by adding this
2128
 
   section to your ``.dput.cf``::
2129
 
 
2130
 
     [ubuntu]
2131
 
     fqdn = SPECIFY.A.PPA.NAME
2132
 
 
2133
 
#. You should soon get an "upload accepted" mail from Launchpad, which
2134
 
   means that your package is waiting to be built.  You can then track its
2135
 
   progress in <https://launchpad.net/~bzr/+archive> and
2136
 
   <https://launchpad.net/~bzr/+archive/+builds>.
 
1866
  fixing them. 
2137
1867
 
2138
1868
 
2139
1869
..