51
51
trees or versioned trees.
54
def changes_from(self, other):
54
def changes_from(self, other, want_unchanged=False, specific_files=None,
55
extra_trees=None, require_versioned=False):
55
56
"""Return a TreeDelta of the changes from other to this tree.
57
58
:param other: A tree to compare with.
59
:param specific_files: An optional list of file paths to restrict the
60
comparison to. When mapping filenames to ids, all matches in all
61
trees (including optional extra_trees) are used, and all children of
62
matched directories are included.
63
:param want_unchanged: An optional boolean requesting the inclusion of
64
unchanged entries in the result.
65
:param extra_trees: An optional list of additional trees to use when
66
mapping the contents of specific_files (paths) to file_ids.
67
:param require_versioned: An optional boolean (defaults to False). When
68
supplied and True all the 'specific_files' must be versioned, or
69
a PathsNotVersionedError will be thrown.
58
71
The comparison will be performed by an InterTree object looked up on
61
74
# Martin observes that Tree.changes_from returns a TreeDelta and this
62
75
# may confuse people, because the class name of the returned object is
63
76
# a synonym of the object referenced in the method name.
64
return InterTree.get(other, self).compare()
77
return InterTree.get(other, self).compare(
78
want_unchanged=want_unchanged,
79
specific_files=specific_files,
80
extra_trees=extra_trees,
81
require_versioned=require_versioned,
66
84
def conflicts(self):
67
85
"""Get a list of the conflicts in the tree.
359
377
_optimisers = set()
362
"""Compare source and target.
379
def compare(self, want_unchanged=False, specific_files=None,
380
extra_trees=None, require_versioned=False):
381
"""Return the changes from source to target.
364
383
:return: A TreeDelta.
384
:param specific_files: An optional list of file paths to restrict the
385
comparison to. When mapping filenames to ids, all matches in all
386
trees (including optional extra_trees) are used, and all children of
387
matched directories are included.
388
:param want_unchanged: An optional boolean requesting the inclusion of
389
unchanged entries in the result.
390
:param extra_trees: An optional list of additional trees to use when
391
mapping the contents of specific_files (paths) to file_ids.
392
:param require_versioned: An optional boolean (defaults to False). When
393
supplied and True all the 'specific_files' must be versioned, or
394
a PathsNotVersionedError will be thrown.
366
396
# imported later to avoid circular imports
367
397
from bzrlib.delta import compare_trees
368
return compare_trees(self.source, self.target)
398
return compare_trees(
401
want_unchanged=want_unchanged,
402
specific_files=specific_files,
403
extra_trees=extra_trees,
404
require_versioned=require_versioned,