filelog: show the passed argument on error
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 06 Apr 2021 03:24:26 +0200
changeset 49207 8960d8eb747b
parent 49206 b5858e02e3ba
child 49211 675594a0a71a
filelog: show the passed argument on error The error now do more than stating what it need. It also state what it got.
mercurial/filelog.py
--- a/mercurial/filelog.py	Tue Apr 06 03:23:46 2021 +0200
+++ b/mercurial/filelog.py	Tue Apr 06 03:24:26 2021 +0200
@@ -240,7 +240,9 @@
     # Used by repo upgrade.
     def clone(self, tr, destrevlog, **kwargs):
         if not isinstance(destrevlog, filelog):
-            raise error.ProgrammingError(b'expected filelog to clone()')
+            msg = b'expected filelog to clone(), not %r'
+            msg %= destrevlog
+            raise error.ProgrammingError(msg)
 
         return self._revlog.clone(tr, destrevlog._revlog, **kwargs)