1
# Copyright (C) 2005, 2006 Canonical Ltd
1
# Copyright (C) 2005-2010 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
89
87
if (parent_ie.file_id in self.base_tree):
90
88
base_parent_ie = self.base_tree.inventory[parent_ie.file_id]
91
base_child_ie = base_parent_ie.children.get(path.base_path)
89
base_child_ie = base_parent_ie.children.get(
90
bzrlib.osutils.basename(path))
92
91
if base_child_ie is not None:
93
92
return (base_child_ie.file_id,
94
93
self.base_tree.id2path(base_child_ie.file_id))
95
full_base_path = bzrlib.osutils.pathjoin(self.base_path, path.raw_path)
94
full_base_path = bzrlib.osutils.pathjoin(self.base_path, path)
96
95
# This may return None, but it is our last attempt
97
96
return self.base_tree.path2id(full_base_path), full_base_path
100
# TODO: jam 20050105 These could be used for compatibility
101
# however, they bind against the current stdout, not the
102
# one which exists at the time they are called, so they
103
# don't work for the test suite.
105
add_action_add = AddAction()
106
add_action_null = add_action_add
107
add_action_add_and_print = AddAction(should_print=True)
108
add_action_print = add_action_add_and_print