diff mercurial/exchange.py @ 22972:44b16b59b80a

pull: add source information to the transaction The source information can, should be applied once when opening the transaction for the pull. This will lets element processed within a bundle2 be aware of them and open the door to running a set of hooks when closing this pull transaction. This is similar to what is done in server's unbundle call.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 14 Oct 2014 01:40:04 -0700
parents 3fe571c74b27
children 90c425f80316
line wrap: on
line diff
--- a/mercurial/exchange.py	Tue Oct 14 00:06:46 2014 -0700
+++ b/mercurial/exchange.py	Tue Oct 14 01:40:04 2014 -0700
@@ -827,6 +827,8 @@
         """get appropriate pull transaction, creating it if needed"""
         if self._tr is None:
             self._tr = self.repo.transaction(self._trname)
+            self._tr.hookargs['source'] = 'pull'
+            self._tr.hookargs['url'] = self.remote.url()
         return self._tr
 
     def closetransaction(self):