Merge lp:~jelmer/brz/diff-tree-reference into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/diff-tree-reference
Merge into: lp:brz
Diff against target: 35 lines (+17/-1)
1 file modified
breezy/diff.py (+17/-1)
To merge this branch: bzr merge lp:~jelmer/brz/diff-tree-reference
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+355881@code.launchpad.net

Commit message

Support running diff on tree references.

Description of the change

Support running diff on tree references.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/diff.py'
--- breezy/diff.py 2018-11-25 21:48:55 +0000
+++ breezy/diff.py 2019-02-09 10:34:25 +0000
@@ -570,6 +570,21 @@
570 self.differs, old_path, new_path, None, new_kind)570 self.differs, old_path, new_path, None, new_kind)
571571
572572
573class DiffTreeReference(DiffPath):
574
575 def diff(self, old_path, new_path, old_kind, new_kind):
576 """Perform comparison between two tree references. (dummy)
577
578 """
579 if 'tree-reference' not in (old_kind, new_kind):
580 return self.CANNOT_DIFF
581 if old_kind not in ('tree-reference', None):
582 return self.CANNOT_DIFF
583 if new_kind not in ('tree-reference', None):
584 return self.CANNOT_DIFF
585 return self.CHANGED
586
587
573class DiffDirectory(DiffPath):588class DiffDirectory(DiffPath):
574589
575 def diff(self, old_path, new_path, old_kind, new_kind):590 def diff(self, old_path, new_path, old_kind, new_kind):
@@ -880,7 +895,8 @@
880 # list of factories that can provide instances of DiffPath objects895 # list of factories that can provide instances of DiffPath objects
881 # may be extended by plugins.896 # may be extended by plugins.
882 diff_factories = [DiffSymlink.from_diff_tree,897 diff_factories = [DiffSymlink.from_diff_tree,
883 DiffDirectory.from_diff_tree]898 DiffDirectory.from_diff_tree,
899 DiffTreeReference.from_diff_tree]
884900
885 def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8',901 def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8',
886 diff_text=None, extra_factories=None):902 diff_text=None, extra_factories=None):

Subscribers

People subscribed via source and target branches