Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
22971:3fe571c74b27 | 22972:44b16b59b80a |
---|---|
825 | 825 |
826 def gettransaction(self): | 826 def gettransaction(self): |
827 """get appropriate pull transaction, creating it if needed""" | 827 """get appropriate pull transaction, creating it if needed""" |
828 if self._tr is None: | 828 if self._tr is None: |
829 self._tr = self.repo.transaction(self._trname) | 829 self._tr = self.repo.transaction(self._trname) |
830 self._tr.hookargs['source'] = 'pull' | |
831 self._tr.hookargs['url'] = self.remote.url() | |
830 return self._tr | 832 return self._tr |
831 | 833 |
832 def closetransaction(self): | 834 def closetransaction(self): |
833 """close transaction if created""" | 835 """close transaction if created""" |
834 if self._tr is not None: | 836 if self._tr is not None: |