~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
277
277
                        new_abspath, e)
278
278
 
279
279
 
280
 
def _get_trees_to_diff(path_list, revision_specs, old_url, new_url,
281
 
    apply_view=True):
 
280
def get_trees_and_branches_to_diff(path_list, revision_specs, old_url, new_url,
 
281
                                   apply_view=True):
282
282
    """Get the trees and specific files to diff given a list of paths.
283
283
 
284
284
    This method works out the trees to be diff'ed and the files of
299
299
        if True and a view is set, apply the view or check that the paths
300
300
        are within it
301
301
    :returns:
302
 
        a tuple of (old_tree, new_tree, specific_files, extra_trees) where
303
 
        extra_trees is a sequence of additional trees to search in for
304
 
        file-ids.
 
302
        a tuple of (old_tree, new_tree, old_branch, new_branch,
 
303
        specific_files, extra_trees) where extra_trees is a sequence of
 
304
        additional trees to search in for file-ids.
305
305
    """
306
306
    # Get the old and new revision specs
307
307
    old_revision_spec = None
341
341
            views.check_path_in_view(working_tree, relpath)
342
342
        specific_files.append(relpath)
343
343
    old_tree = _get_tree_to_diff(old_revision_spec, working_tree, branch)
 
344
    old_branch = branch
344
345
 
345
346
    # Get the new location
346
347
    if new_url is None:
354
355
            specific_files.append(relpath)
355
356
    new_tree = _get_tree_to_diff(new_revision_spec, working_tree, branch,
356
357
        basis_is_default=working_tree is None)
 
358
    new_branch = branch
357
359
 
358
360
    # Get the specific files (all files is None, no files is [])
359
361
    if make_paths_wt_relative and working_tree is not None:
378
380
    extra_trees = None
379
381
    if working_tree is not None and working_tree not in (old_tree, new_tree):
380
382
        extra_trees = (working_tree,)
381
 
    return old_tree, new_tree, specific_files, extra_trees
 
383
    return old_tree, new_tree, old_branch, new_branch, specific_files, extra_trees
 
384
 
382
385
 
383
386
def _get_tree_to_diff(spec, tree=None, branch=None, basis_is_default=True):
384
387
    if branch is None and tree is not None: