changeset 37237:7e906d8a825f

bundle2: add 'source' atrribute to bundleoperation class This will help us in easily finding out which command leads to the current operation without hacking on the transaction. Differential Revision: https://phab.mercurial-scm.org/D2993
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 31 Mar 2018 14:47:43 +0530
parents c1fac3878196
children 9041c91561fc
files mercurial/bundle2.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Mar 31 10:13:05 2018 -0700
+++ b/mercurial/bundle2.py	Sat Mar 31 14:47:43 2018 +0530
@@ -299,7 +299,7 @@
     * a way to construct a bundle response when applicable.
     """
 
-    def __init__(self, repo, transactiongetter, captureoutput=True):
+    def __init__(self, repo, transactiongetter, captureoutput=True, source=''):
         self.repo = repo
         self.ui = repo.ui
         self.records = unbundlerecords()
@@ -309,6 +309,7 @@
         self._gettransaction = transactiongetter
         # carries value that can modify part behavior
         self.modes = {}
+        self.source = source
 
     def gettransaction(self):
         transaction = self._gettransaction()