~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_pull.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-01 07:30:00 UTC
  • mfrom: (2220.2.49 tags)
  • Revision ID: pqm@pqm.ubuntu.com-20070301073000-0bfe1394fee5e712
(mbp) tags in branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
100
100
        self.hook_calls = []
101
101
        TestCaseWithBranch.setUp(self)
102
102
 
103
 
    def capture_post_pull_hook(self, source, local, master, old_revno,
104
 
        old_revid, new_revno, new_revid):
 
103
    def capture_post_pull_hook(self, result):
105
104
        """Capture post pull hook calls to self.hook_calls.
106
105
        
107
106
        The call is logged, as is some state of the two branches.
108
107
        """
109
 
        if local:
110
 
            local_locked = local.is_locked()
111
 
            local_base = local.base
 
108
        if result.local_branch:
 
109
            local_locked = result.local_branch.is_locked()
 
110
            local_base = result.local_branch.base
112
111
        else:
113
112
            local_locked = None
114
113
            local_base = None
115
114
        self.hook_calls.append(
116
 
            ('post_pull', source, local_base, master.base, old_revno, old_revid,
117
 
             new_revno, new_revid, source.is_locked(), local_locked,
118
 
             master.is_locked()))
 
115
            ('post_pull', result.source_branch, local_base,
 
116
             result.master_branch.base, result.old_revno,
 
117
             result.old_revid,
 
118
             result.new_revno, result.new_revid,
 
119
             result.source_branch.is_locked(), local_locked,
 
120
             result.master_branch.is_locked()))
119
121
 
120
122
    def test_post_pull_empty_history(self):
121
123
        target = self.make_branch('target')