~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/uncommit.py

  • Committer: v.ladeuil+lp at free
  • Date: 2007-05-18 18:20:31 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070518182031-gbg2cgidv5l20x9p
Takes Robert comments into account.

* bzrlib/transport/ftp.py:
(FtpTransport.__init__): Write a better explanation.

* bzrlib/tests/test_init.py:
(InstrumentedTransport): Just make hooks a class attribute.
(InstrumentedTransport._get_FTP): Run hook directly in the for
loop.
(TransportHooks.run_hook, TransportHooks.uninstall_hook): Not
needed. The hooks should be cleaned up by the test itself.
(TestInit.setUp.cleanup): Resset to default hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
23
 
from bzrlib import revision as _mod_revision
24
23
from bzrlib.branch import Branch
25
24
from bzrlib.errors import BoundBranchOutOfDate
26
25
 
77
76
            if master is not None:
78
77
                master.set_revision_history(rh)
79
78
            branch.set_revision_history(rh)
80
 
            new_tip = _mod_revision.ensure_null(branch.last_revision())
 
79
            new_tip = branch.last_revision()
81
80
            if master is None:
82
81
                hook_local = None
83
82
                hook_master = branch
85
84
                hook_local = branch
86
85
                hook_master = master
87
86
            for hook in Branch.hooks['post_uncommit']:
88
 
                hook_new_tip = new_tip
89
 
                if hook_new_tip == _mod_revision.NULL_REVISION:
90
 
                    hook_new_tip = None
91
87
                hook(hook_local, hook_master, old_revno, old_tip, new_revno,
92
 
                     hook_new_tip)
 
88
                    new_tip)
93
89
            if tree is not None:
94
 
                if not _mod_revision.is_null(new_tip):
 
90
                if new_tip is not None:
95
91
                    parents = [new_tip]
96
92
                else:
97
93
                    parents = []