Patchwork [3,of,6,V2] journal: use wrapfilecache instead of wrapfunction on func of filecache

login
register
mail settings
Submitter Katsunori FUJIWARA
Date July 10, 2017, 2:18 p.m.
Message ID <826ccec0e5c33bedeb95.1499696296@speaknoevil>
Download mbox | patch
Permalink /patch/22201/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - July 10, 2017, 2:18 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1499695791 -32400
#      Mon Jul 10 23:09:51 2017 +0900
# Node ID 826ccec0e5c33bedeb95f6f60b397e3565b209ec
# Parent  7ae6b72cb5da75670c00b00fe096cec22e0de731
journal: use wrapfilecache instead of wrapfunction on func of filecache

wrapfilecache() on filecache-ed property works more strictly than
wrapfunction() directly on func() of filecache.

Patch

diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -61,8 +61,8 @@  sharednamespaces = {
 def extsetup(ui):
     extensions.wrapfunction(dispatch, 'runcommand', runcommand)
     extensions.wrapfunction(bookmarks.bmstore, '_write', recordbookmarks)
-    extensions.wrapfunction(
-        localrepo.localrepository.dirstate, 'func', wrapdirstate)
+    extensions.wrapfilecache(
+        localrepo.localrepository, 'dirstate', wrapdirstate)
     extensions.wrapfunction(hg, 'postshare', wrappostshare)
     extensions.wrapfunction(hg, 'copystore', unsharejournal)