diff hgext/largefiles/localstore.py @ 15316:c65f5b6e26d4 stable

largefiles: rename functions and methods to match desired behavior The original intent was that the largefiles would primarily be in the repository, with the global cache being only that--a cache. The naming conventions and actual intent have both strayed. In this first patch, the naming conventions are switched to match the actual intent, as are the configuration options.
author Benjamin Pollack <benjamin@bitquabit.com>
date Thu, 20 Oct 2011 13:24:09 -0400
parents 6e809bb4f969
children 41f371150ccb
line wrap: on
line diff
--- a/hgext/largefiles/localstore.py	Thu Oct 20 13:24:08 2011 -0400
+++ b/hgext/largefiles/localstore.py	Thu Oct 20 13:24:09 2011 -0400
@@ -31,11 +31,11 @@
         return
 
     def exists(self, hash):
-        return lfutil.insystemcache(self.repo.ui, hash)
+        return lfutil.inusercache(self.repo.ui, hash)
 
     def _getfile(self, tmpfile, filename, hash):
-        if lfutil.insystemcache(self.ui, hash):
-            return lfutil.systemcachepath(self.ui, hash)
+        if lfutil.inusercache(self.ui, hash):
+            return lfutil.usercachepath(self.ui, hash)
         raise basestore.StoreError(filename, hash, '',
             _("Can't get file locally"))
 
@@ -50,7 +50,7 @@
 
         expecthash = fctx.data()[0:40]
         verified.add(key)
-        if not lfutil.insystemcache(self.ui, expecthash):
+        if not lfutil.inusercache(self.ui, expecthash):
             self.ui.warn(
                 _('changeset %s: %s missing\n'
                   '  (looked for hash %s)\n')
@@ -58,7 +58,7 @@
             return True                 # failed
 
         if contents:
-            storepath = lfutil.systemcachepath(self.ui, expecthash)
+            storepath = lfutil.usercachepath(self.ui, expecthash)
             actualhash = lfutil.hashfile(storepath)
             if actualhash != expecthash:
                 self.ui.warn(