setup: make debug simpler by adding a `__repr__` to `hgcommand`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Dec 2023 22:13:37 +0100
changeset 51191 3c5b66d03c37
parent 51190 ac3859a8b796
child 51192 f816ca29a285
setup: make debug simpler by adding a `__repr__` to `hgcommand` This help when trying to debug this logic.
setup.py
--- a/setup.py	Wed Nov 15 18:43:03 2023 +0000
+++ b/setup.py	Fri Dec 01 22:13:37 2023 +0100
@@ -221,6 +221,9 @@
         self.cmd = cmd
         self.env = env
 
+    def __repr__(self):
+        return f"<hgcommand cmd={self.cmd} env={self.env}>"
+
     def run(self, args):
         cmd = self.cmd + args
         returncode, out, err = runcmd(cmd, self.env)
@@ -1821,5 +1824,5 @@
             'welcome': 'contrib/packaging/macosx/Welcome.html',
         },
     },
-    **extra
+    **extra,
 )