Patchwork bundle2: drop the experimental hooks

login
register
mail settings
Submitter Pierre-Yves David
Date April 10, 2015, 10:15 p.m.
Message ID <8cb03825f3a3fe0ae22c.1428704132@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/8601/
State Accepted
Commit 52ff737c63d2b2cb41185549aa9c35bc47317032
Headers show

Comments

Pierre-Yves David - April 10, 2015, 10:15 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1428610718 14400
#      Thu Apr 09 16:18:38 2015 -0400
# Node ID 8cb03825f3a3fe0ae22cf54adec000092a0f262b
# Parent  e0e28e910fa3797fd0aa4f818e9b33c5bcbf0e53
bundle2: drop the experimental hooks

The series at e9ede9b4c2f8::8e13cc0825f1 introduced generic transaction level
hooking. This makes the experimental bundle2 specific hooks redundant, we drop
them.
Matt Mackall - April 10, 2015, 11:41 p.m.
On Fri, 2015-04-10 at 18:15 -0400, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1428610718 14400
> #      Thu Apr 09 16:18:38 2015 -0400
> # Node ID 8cb03825f3a3fe0ae22cf54adec000092a0f262b
> # Parent  e0e28e910fa3797fd0aa4f818e9b33c5bcbf0e53
> bundle2: drop the experimental hooks

Queued for default, thanks.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -849,19 +849,10 @@  class transactionmanager(object):
         return self._tr
 
     def close(self):
         """close transaction if created"""
         if self._tr is not None:
-            repo = self.repo
-            p = lambda: self._tr.writepending() and repo.root or ""
-            repo.hook('b2x-pretransactionclose', throw=True, pending=p,
-                      **self._tr.hookargs)
-            hookargs = dict(self._tr.hookargs)
-            def runhooks():
-                repo.hook('b2x-transactionclose', **hookargs)
-            self._tr.addpostclose('b2x-hook-transactionclose',
-                                  lambda tr: repo._afterlock(runhooks))
             self._tr.close()
 
     def release(self):
         """release transaction if created"""
         if self._tr is not None:
@@ -1288,18 +1279,10 @@  def unbundle(repo, cg, heads, source, ur
                 tr = repo.transaction('unbundle')
                 tr.hookargs['source'] = source
                 tr.hookargs['url'] = url
                 tr.hookargs['bundle2'] = '1'
                 r = bundle2.processbundle(repo, cg, lambda: tr).reply
-                p = lambda: tr.writepending() and repo.root or ""
-                repo.hook('b2x-pretransactionclose', throw=True, pending=p,
-                          **tr.hookargs)
-                hookargs = dict(tr.hookargs)
-                def runhooks():
-                    repo.hook('b2x-transactionclose', **hookargs)
-                tr.addpostclose('b2x-hook-transactionclose',
-                                lambda tr: repo._afterlock(runhooks))
                 tr.close()
             except Exception, exc:
                 exc.duringunbundle2 = True
                 raise
         else: