diff hgext/largefiles/basestore.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 225d30bacabd
children 9da7e96cd5c2
line wrap: on
line diff
--- a/hgext/largefiles/basestore.py	Thu Oct 20 13:24:08 2011 -0400
+++ b/hgext/largefiles/basestore.py	Thu Oct 20 13:24:09 2011 -0400
@@ -74,13 +74,13 @@
             at += 1
             ui.note(_('getting %s:%s\n') % (filename, hash))
 
-            cachefilename = lfutil.cachepath(self.repo, hash)
-            cachedir = os.path.dirname(cachefilename)
+            storefilename = lfutil.storepath(self.repo, hash)
+            storedir = os.path.dirname(storefilename)
 
             # No need to pass mode='wb' to fdopen(), since mkstemp() already
             # opened the file in binary mode.
             (tmpfd, tmpfilename) = tempfile.mkstemp(
-                dir=cachedir, prefix=os.path.basename(filename))
+                dir=storedir, prefix=os.path.basename(filename))
             tmpfile = os.fdopen(tmpfd, 'w')
 
             try:
@@ -98,10 +98,10 @@
                 missing.append(filename)
                 continue
 
-            if os.path.exists(cachefilename): # Windows
-                os.remove(cachefilename)
-            os.rename(tmpfilename, cachefilename)
-            lfutil.linktosystemcache(self.repo, hash)
+            if os.path.exists(storefilename): # Windows
+                os.remove(storefilename)
+            os.rename(tmpfilename, storefilename)
+            lfutil.linktousercache(self.repo, hash)
             success.append((filename, hhash))
 
         ui.progress(_('getting largefiles'), None)