/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 14:22:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5174.
  • Revision ID: panta@elasticworld.org-20100325142241-vtl1hshva7uiz3ap
Applied suggestions from merge reviewer (John A Meinel):

- removed duplication of checks for presence of hooks.
- adapted to bazaar style guideline
- simplified test cases callback

Show diffs side-by-side

added added

removed removed

Lines of Context:
1546
1546
            if lock_taken:
1547
1547
                control_files.unlock()
1548
1548
        branch = self.open(a_bzrdir, name, _found=True)
1549
 
        if Branch.hooks['post_branch_init']:
1550
 
            self._run_post_branch_init_hooks(a_bzrdir, name, branch)
 
1549
        self._run_post_branch_init_hooks(a_bzrdir, name, branch)
1551
1550
        return branch
1552
1551
 
1553
1552
    def initialize(self, a_bzrdir, name=None):
1767
1766
            self.__class__.__name__, self.branch,
1768
1767
            self.old_revno, self.old_revid, self.new_revno, self.new_revid)
1769
1768
 
 
1769
 
1770
1770
class BranchInitHookParams(object):
1771
1771
    """Object holding parameters passed to *_branch_init hooks.
1772
1772
 
1788
1788
        """
1789
1789
        self.format = format
1790
1790
        self.bzrdir = a_bzrdir
1791
 
        self.name   = name
 
1791
        self.name = name
1792
1792
        self.branch = branch
1793
1793
 
1794
1794
    def __eq__(self, other):
1802
1802
                self.__class__.__name__, self.branch,
1803
1803
                self.format, self.bzrdir)
1804
1804
 
 
1805
 
1805
1806
class SwitchHookParams(object):
1806
1807
    """Object holding parameters passed to *_switch hooks.
1807
1808
 
1822
1823
        :param revision_id: revision ID to switch to (or None)
1823
1824
        """
1824
1825
        self.control_dir = control_dir
1825
 
        self.to_branch   = to_branch
1826
 
        self.force       = force
 
1826
        self.to_branch = to_branch
 
1827
        self.force = force
1827
1828
        self.revision_id = revision_id
1828
1829
 
1829
1830
    def __eq__(self, other):
1834
1835
            self.control_dir, self.to_branch,
1835
1836
            self.revision_id)
1836
1837
 
 
1838
 
1837
1839
class BzrBranchFormat4(BranchFormat):
1838
1840
    """Bzr branch format 4.
1839
1841
 
2111
2113
        branch = self.open(
2112
2114
            a_bzrdir, name, _found=True,
2113
2115
            possible_transports=[target_branch.bzrdir.root_transport])
2114
 
        if Branch.hooks['post_branch_init']:
2115
 
            self._run_post_branch_init_hooks(a_bzrdir, name, branch)
 
2116
        self._run_post_branch_init_hooks(a_bzrdir, name, branch)
2116
2117
        return branch
2117
2118
 
2118
2119
    def __init__(self):