diff mercurial/metadata.py @ 45728:232c88dd89e3

changing-files: add a shorthand property to check for copy relevant info We are going to reuse this change in more place, so we factor it out first. Differential Revision: https://phab.mercurial-scm.org/D9197
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Oct 2020 03:23:17 +0200
parents e53778ad64bf
children 53c265a6fc83
line wrap: on
line diff
--- a/mercurial/metadata.py	Wed Oct 14 17:51:56 2020 +0200
+++ b/mercurial/metadata.py	Tue Oct 13 03:23:17 2020 +0200
@@ -75,6 +75,16 @@
             and self.copied_from_p2 == other.copied_from_p2
         )
 
+    @property
+    def has_copies_info(self):
+        return bool(
+            self.removed
+            or self.merged
+            or self.salvaged
+            or self.copied_from_p1
+            or self.copied_from_p2
+        )
+
     @util.propertycache
     def added(self):
         """files actively added in the changeset