~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-08 17:26:36 UTC
  • mfrom: (4732.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091008172636-tygnfi5hsnn9203g
(garyvdm) Make diff.get_trees_and_branches_to_diff a public API

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
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
382
384
 
383
385
def _get_tree_to_diff(spec, tree=None, branch=None, basis_is_default=True):
384
386
    if branch is None and tree is not None: