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

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 16, 2013, 11:21 p.m.
Message ID <0e6ce07750ac612a5953.1384644069@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2996/
State Accepted
Commit 9a72d38868884b2db18528b451412c2e6418ac1e
Headers show

Comments

Siddharth Agarwal - Nov. 16, 2013, 11:21 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@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.

Patch

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