375
375
if revision_specs is not None:
376
376
if len(revision_specs) > 0:
377
377
old_revision_spec = revision_specs[0]
379
old_url = old_revision_spec.get_branch()
378
380
if len(revision_specs) > 1:
379
381
new_revision_spec = revision_specs[1]
380
# If both revision specs include a branch, we can diff them
381
# without needing to look further for the details
382
if (old_revision_spec is not None and
383
new_revision_spec is not None and
384
not old_revision_spec.needs_branch() and
385
not new_revision_spec.needs_branch()):
386
old_tree = _get_tree_to_diff(old_revision_spec)
387
new_tree = _get_tree_to_diff(new_revision_spec)
388
specific_files = path_list or None
389
return old_tree, new_tree, specific_files, None
383
new_url = new_revision_spec.get_branch()
386
make_paths_wt_relative = True
391
387
if path_list is None or len(path_list) == 0:
392
388
# If no path is given, assume the current directory
393
389
default_location = u'.'
396
390
elif old_url is not None and new_url is not None:
397
default_location = None # don't care - not required
398
391
other_paths = path_list
392
make_paths_wt_relative = False
401
394
default_location = path_list[0]
402
395
other_paths = path_list[1:]
405
397
# Get the old location
406
398
specific_files = []
424
416
basis_is_default=working_tree is None)
426
418
# Get the specific files (all files is None, no files is [])
427
if check_paths and working_tree is not None:
419
if make_paths_wt_relative and working_tree is not None:
428
420
other_paths = _relative_paths_in_tree(working_tree, other_paths)
429
421
specific_files.extend(other_paths)
430
422
if len(specific_files) == 0:
433
425
# Get extra trees that ought to be searched for file-ids
434
426
extra_trees = None
435
if new_tree != working_tree and working_tree is not None:
427
if working_tree is not None and working_tree not in (old_tree, new_tree):
436
428
extra_trees = (working_tree,)
437
429
return old_tree, new_tree, specific_files, extra_trees