changeset 3365:911c91ce686f

caches: record 'desc' attribute on transaction This is useful to know if a transaction if server side or not.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 05 Jan 2018 22:17:27 +0100
parents 9df35258e0c5
children 83b372eceb81
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.