[PATCH 3 of 6] scmutil.filecacheentry: make stat argument to constructor mandatory

Siddharth Agarwal sid0 at fb.com
Sat Nov 16 17:21:09 CST 2013


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1384637613 28800
#      Sat Nov 16 13:33:33 2013 -0800
# Node ID 0e6ce07750ac612a595305e9a60a58b4e0659188
# Parent  aa53cc8a5308acadd45843e4c261f535f7ba11ac
scmutil.filecacheentry: make stat argument to constructor mandatory

There's no real upside to making stat optional -- this constructor has just two
callers.

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -852,7 +852,7 @@
     return requirements
 
 class filecacheentry(object):
-    def __init__(self, path, stat=True):
+    def __init__(self, path, stat):
         self.path = path
         self.cachestat = None
         self._cacheable = None
@@ -952,7 +952,7 @@
 
             # We stat -before- creating the object so our cache doesn't lie if
             # a writer modified between the time we read and stat
-            entry = filecacheentry(path)
+            entry = filecacheentry(path, True)
             entry.obj = self.func(obj)
 
             obj._filecache[self.name] = entry


More information about the Mercurial-devel mailing list