~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

[merge] from robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
            base_tree = branch.revision_tree(revision)
218
218
    temp_path = os.path.join(temp_root, label)
219
219
    os.mkdir(temp_path)
220
 
    return MergeTree(base_tree, temp_path)
 
220
    return MergeAdapterTree(base_tree, temp_path)
221
221
 
222
222
 
223
223
def file_exists(tree, file_id):
224
224
    return tree.has_filename(tree.id2path(file_id))
225
225
    
226
226
 
227
 
class MergeTree(object):
 
227
class MergeAdapterTree(object):
 
228
    """MergeAdapterTree adapts a normal tree for merge_inner to use.
 
229
 
 
230
    The interface the merge_inner needs is nearly but not quite
 
231
    the same as that of bzrlib.tree with the exception of readonly_path.
 
232
    """
 
233
    
228
234
    def __init__(self, tree, tempdir):
229
235
        object.__init__(self)
230
236
        if hasattr(tree, "basedir"):
384
390
            interesting_ids = set()
385
391
            this_tree = this_branch.working_tree()
386
392
            for fname in file_list:
387
 
                path = this_branch.relpath(fname)
 
393
                path = this_tree.relpath(fname)
388
394
                found_id = False
389
395
                for tree in (this_tree, base_tree.tree, other_tree.tree):
390
396
                    file_id = tree.inventory.path2id(path)