changeset 45014:cfd06649a1b8

copies: implement __repr__ on branch_copies for debugging Differential Revision: https://phab.mercurial-scm.org/D8650
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 19 Jun 2020 09:27:02 -0700
parents 98f97026fa05
children 2c920c4dbb31
files mercurial/copies.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/copies.py	Sat Jun 20 11:10:23 2020 +0900
+++ b/mercurial/copies.py	Fri Jun 19 09:27:02 2020 -0700
@@ -636,6 +636,12 @@
         self.dirmove = {} if dirmove is None else dirmove
         self.movewithdir = {} if movewithdir is None else movewithdir
 
+    def __repr__(self):
+        return (
+            '<branch_copies\n  copy=%r\n  renamedelete=%r\n  dirmove=%r\n  movewithdir=%r\n>'
+            % (self.copy, self.renamedelete, self.dirmove, self.movewithdir,)
+        )
+
 
 def _fullcopytracing(repo, c1, c2, base):
     """ The full copytracing algorithm which finds all the new files that were