caches: record 'desc' attribute on transaction
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 05 Jan 2018 22:17:27 +0100
changeset 3365 911c91ce686f
parent 3364 9df35258e0c5
child 3366 83b372eceb81
caches: record 'desc' attribute on transaction This is useful to know if a transaction if server side or not.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Fri Jan 05 04:37:49 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Fri Jan 05 22:17:27 2018 +0100
@@ -423,6 +423,15 @@
     if obsolete.isenabled(repo, 'exchange'):
         repo.ui.setconfig('server', 'bundle1', False)
 
+    class trdescrepo(repo.__class__):
+
+        def transaction(self, desc, *args, **kwargs):
+            tr = super(trdescrepo, self).transaction(desc, *args, **kwargs)
+            tr.desc = desc
+            return tr
+
+    repo.__class__ = trdescrepo
+
 @eh.uisetup
 def _configurecmdoptions(ui):
     # Unregister evolve commands if the command capability is not specified.