1
# Copyright (C) 2004, 2005 Canonical Ltd
1
# Copyright (C) 2004, 2005, 2007 Canonical Ltd
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)
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.
107
106
The call is logged, as is some state of the two branches.
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
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,
115
('post_pull', result.source_branch, local_base,
116
result.master_branch.base, result.old_revno,
118
result.new_revno, result.new_revid,
119
result.source_branch.is_locked(), local_locked,
120
result.master_branch.is_locked()))
120
122
def test_post_pull_empty_history(self):
121
123
target = self.make_branch('target')