fsmonitor: remove watchman transaction and working copy change notifications
Remove working copy change and transaction notifications. We were relying
upon callbacks on transaction function. This caused issues with lock ordering.
A different approach will be adopted in a subsequent commit.
Differential Revision: https://phab.mercurial-scm.org/D1611
--- a/hgext/fsmonitor/__init__.py Fri Dec 08 16:54:59 2017 +0900
+++ b/hgext/fsmonitor/__init__.py Wed Dec 06 18:37:49 2017 -0800
@@ -117,7 +117,6 @@
from mercurial.i18n import _
from mercurial.node import (
hex,
- nullid,
)
from mercurial import (
@@ -162,12 +161,6 @@
configitem('fsmonitor', 'blacklistusers',
default=list,
)
-configitem('experimental', 'fsmonitor.transaction_notify',
- default=False,
-)
-configitem('experimental', 'fsmonitor.wc_change_notify',
- default=False,
-)
# This extension is incompatible with the following blacklisted extensions
# and will disable itself when encountering one of these:
@@ -609,14 +602,6 @@
self._fsmonitorstate.invalidate()
return super(fsmonitordirstate, self).invalidate(*args, **kwargs)
- if dirstate._ui.configbool(
- "experimental", "fsmonitor.wc_change_notify"):
- def setparents(self, p1, p2=nullid):
- with state_update(self._repo, name="hg.wc_change",
- oldnode=self._pl[0], newnode=p1,
- partial=False):
- return super(fsmonitordirstate, self).setparents(p1, p2)
-
dirstate.__class__ = fsmonitordirstate
dirstate._fsmonitorinit(repo)
@@ -799,32 +784,4 @@
orig = super(fsmonitorrepo, self).status
return overridestatus(orig, self, *args, **kwargs)
- if ui.configbool("experimental", "fsmonitor.transaction_notify"):
- def transaction(self, *args, **kwargs):
- tr = super(fsmonitorrepo, self).transaction(
- *args, **kwargs)
- if tr.count != 1:
- return tr
- stateupdate = state_update(self, name="hg.transaction")
- stateupdate.enter()
-
- class fsmonitortrans(tr.__class__):
- def _abort(self):
- try:
- result = super(fsmonitortrans, self)._abort()
- finally:
- stateupdate.exit(abort=True)
- return result
-
- def close(self):
- try:
- result = super(fsmonitortrans, self).close()
- finally:
- if self.count == 0:
- stateupdate.exit()
- return result
-
- tr.__class__ = fsmonitortrans
- return tr
-
repo.__class__ = fsmonitorrepo