/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 bzrlib/branch.py

  • Committer: Marco Pantaleoni
  • Date: 2010-03-25 18:02:45 UTC
  • mto: This revision was merged to the branch mainline in revision 5174.
  • Revision ID: panta@elasticworld.org-20100325180245-1lt7v5stt13m92tr
Documented behaviour of 'post_branch_init' for lightweight checkouts.

Added blackbox tests for the three hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1715
1715
            (2, 2), None))
1716
1716
        self.create_hook(HookPoint('post_branch_init',
1717
1717
            "Called after new branch initialization completes. "
1718
 
            "post_branch_init is called with a bzrlib.branch.BranchInitHookParams. "
1719
 
            "Note that init, branch and checkout will all trigger this hook.",
1720
 
            (2, 2), None))
 
1718
            "post_branch_init is called with a "
 
1719
            "bzrlib.branch.BranchInitHookParams. "
 
1720
            "Note that init, branch and checkout (both heavyweight and "
 
1721
            "lightweight) will all trigger this hook.", (2, 2), None))
1721
1722
        self.create_hook(HookPoint('post_switch',
1722
1723
            "Called after a checkout switches branch. "
1723
1724
            "post_switch is called with a "
1773
1774
    There are 4 fields that hooks may wish to access:
1774
1775
 
1775
1776
    :ivar format: the branch format
1776
 
    :ivar bzrdir: the bzrdir where the branch will be/has been initialized
 
1777
    :ivar bzrdir: the BzrDir where the branch will be/has been initialized
1777
1778
    :ivar name: name of colocated branch, if any (or None)
1778
 
    :ivar branch: the branch
 
1779
    :ivar branch: the branch created
 
1780
 
 
1781
    Note that for lightweight checkouts, the bzrdir and format fields refer to
 
1782
    the checkout, hence they are different from the corresponding fields in
 
1783
    branch, which refer to the original branch.
1779
1784
    """
1780
1785
 
1781
1786
    def __init__(self, format, a_bzrdir, name, branch):
1782
1787
        """Create a group of BranchInitHook parameters.
1783
1788
 
1784
1789
        :param format: the branch format
1785
 
        :param a_bzrdir: the bzrdir where the branch will be/has been initialized
 
1790
        :param a_bzrdir: the BzrDir where the branch will be/has been
 
1791
            initialized
1786
1792
        :param name: name of colocated branch, if any (or None)
1787
 
        :param branch: the branch
 
1793
        :param branch: the branch created
 
1794
 
 
1795
        Note that for lightweight checkouts, the bzrdir and format fields refer
 
1796
        to the checkout, hence they are different from the corresponding fields
 
1797
        in branch, which refer to the original branch.
1788
1798
        """
1789
1799
        self.format = format
1790
1800
        self.bzrdir = a_bzrdir