Origin: commit, https://github.com/jelmer/breezy,branch=diff-tree-reference, revision: 7135
Author: Jelmer Vernooĳ <jelmer@jelmer.uk>
Last-Update: 2019-02-04
X-Bzr-Revision-Id: jelmer@jelmer.uk-20190204175806-0l7t993om14cb2ds

=== modified file 'breezy/diff.py'
--- old/breezy/diff.py	2018-11-25 21:48:55 +0000
+++ new/breezy/diff.py	2019-02-04 17:58:06 +0000
@@ -570,6 +570,21 @@
             self.differs, old_path, new_path, None, new_kind)
 
 
+class DiffTreeReference(DiffPath):
+
+    def diff(self, old_path, new_path, old_kind, new_kind):
+        """Perform comparison between two tree references.  (dummy)
+
+        """
+        if 'tree-reference' not in (old_kind, new_kind):
+            return self.CANNOT_DIFF
+        if old_kind not in ('tree-reference', None):
+            return self.CANNOT_DIFF
+        if new_kind not in ('tree-reference', None):
+            return self.CANNOT_DIFF
+        return self.CHANGED
+
+
 class DiffDirectory(DiffPath):
 
     def diff(self, old_path, new_path, old_kind, new_kind):
@@ -880,7 +895,8 @@
     # list of factories that can provide instances of DiffPath objects
     # may be extended by plugins.
     diff_factories = [DiffSymlink.from_diff_tree,
-                      DiffDirectory.from_diff_tree]
+                      DiffDirectory.from_diff_tree,
+                      DiffTreeReference.from_diff_tree]
 
     def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8',
                  diff_text=None, extra_factories=None):

