comparison hgext/largefiles/localstore.py @ 15252:6e809bb4f969

largefiles: improve comments, internal docstrings - fix some ungrammatical/unclear/incorrect comments/docstrings - rewrite some really unclear comments/docstrings - make formatting/style more consistent with the rest of Mercurial (lowercase without period unless it's really multiple sentences) - wrap to 75 columns - always say "largefile(s)", not "lfile(s)" (or "big files") - one space between sentences, not two
author Greg Ward <greg@gerg.ca>
date Wed, 12 Oct 2011 20:59:27 -0400
parents cfccd3bee7b3
children c65f5b6e26d4
comparison
equal deleted inserted replaced
15251:173b00827279 15252:6e809bb4f969
4 # Copyright 2010-2011 Unity Technologies 4 # Copyright 2010-2011 Unity Technologies
5 # 5 #
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version. 7 # GNU General Public License version 2 or any later version.
8 8
9 '''Store class for local filesystem.''' 9 '''store class for local filesystem'''
10 10
11 import os 11 import os
12 12
13 from mercurial import util 13 from mercurial import util
14 from mercurial.i18n import _ 14 from mercurial.i18n import _
15 15
16 import lfutil 16 import lfutil
17 import basestore 17 import basestore
18 18
19 class localstore(basestore.basestore): 19 class localstore(basestore.basestore):
20 '''Because there is a system wide cache, the local store always uses that 20 '''Because there is a system-wide cache, the local store always
21 cache. Since the cache is updated elsewhere, we can just read from it here 21 uses that cache. Since the cache is updated elsewhere, we can
22 as if it were the store.''' 22 just read from it here as if it were the store.'''
23 23
24 def __init__(self, ui, repo, remote): 24 def __init__(self, ui, repo, remote):
25 url = os.path.join(remote.path, '.hg', lfutil.longname) 25 url = os.path.join(remote.path, '.hg', lfutil.longname)
26 super(localstore, self).__init__(ui, repo, util.expandpath(url)) 26 super(localstore, self).__init__(ui, repo, util.expandpath(url))
27 27
28 def put(self, source, filename, hash): 28 def put(self, source, filename, hash):
29 '''Any file that is put must already be in the system wide cache so do 29 '''Any file that is put must already be in the system-wide
30 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.insystemcache(self.repo.ui, hash)
35 35