comparison 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
comparison
equal deleted inserted replaced
15315:ca51a5dd5d0b 15316:c65f5b6e26d4
29 '''Any file that is put must already be in the system-wide 29 '''Any file that is put must already be in the system-wide
30 cache so do nothing.''' 30 cache so do nothing.'''
31 return 31 return
32 32
33 def exists(self, hash): 33 def exists(self, hash):
34 return lfutil.insystemcache(self.repo.ui, hash) 34 return lfutil.inusercache(self.repo.ui, hash)
35 35
36 def _getfile(self, tmpfile, filename, hash): 36 def _getfile(self, tmpfile, filename, hash):
37 if lfutil.insystemcache(self.ui, hash): 37 if lfutil.inusercache(self.ui, hash):
38 return lfutil.systemcachepath(self.ui, hash) 38 return lfutil.usercachepath(self.ui, hash)
39 raise basestore.StoreError(filename, hash, '', 39 raise basestore.StoreError(filename, hash, '',
40 _("Can't get file locally")) 40 _("Can't get file locally"))
41 41
42 def _verifyfile(self, cctx, cset, contents, standin, verified): 42 def _verifyfile(self, cctx, cset, contents, standin, verified):
43 filename = lfutil.splitstandin(standin) 43 filename = lfutil.splitstandin(standin)
48 if key in verified: 48 if key in verified:
49 return False 49 return False
50 50
51 expecthash = fctx.data()[0:40] 51 expecthash = fctx.data()[0:40]
52 verified.add(key) 52 verified.add(key)
53 if not lfutil.insystemcache(self.ui, expecthash): 53 if not lfutil.inusercache(self.ui, expecthash):
54 self.ui.warn( 54 self.ui.warn(
55 _('changeset %s: %s missing\n' 55 _('changeset %s: %s missing\n'
56 ' (looked for hash %s)\n') 56 ' (looked for hash %s)\n')
57 % (cset, filename, expecthash)) 57 % (cset, filename, expecthash))
58 return True # failed 58 return True # failed
59 59
60 if contents: 60 if contents:
61 storepath = lfutil.systemcachepath(self.ui, expecthash) 61 storepath = lfutil.usercachepath(self.ui, expecthash)
62 actualhash = lfutil.hashfile(storepath) 62 actualhash = lfutil.hashfile(storepath)
63 if actualhash != expecthash: 63 if actualhash != expecthash:
64 self.ui.warn( 64 self.ui.warn(
65 _('changeset %s: %s: contents differ\n' 65 _('changeset %s: %s: contents differ\n'
66 ' (%s:\n' 66 ' (%s:\n'