Patchwork [7,of,7] journal: use wrapfilecache instead of wrapping func of filecache directly

login
register
mail settings
Submitter Katsunori FUJIWARA
Date July 2, 2017, 5:53 p.m.
Message ID <9b97a3731a614063a62c.1499018001@speaknoevil>
Download mbox | patch
Permalink /patch/21924/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - July 2, 2017, 5:53 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1499017961 -32400
#      Mon Jul 03 02:52:41 2017 +0900
# Node ID 9b97a3731a614063a62c6f7b42f36ba8d0699c95
# Parent  0dcbaa178353e32b23e13bc8655a6a90978b639d
journal: use wrapfilecache instead of wrapping func of filecache directly

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

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)