fix cache issue, rename provision script

This commit is contained in:
Matthew Scragg 2014-09-03 09:26:53 -05:00
parent 1492448448
commit 0dead5176a
3 changed files with 10 additions and 5 deletions

2
Vagrantfile vendored
View file

@ -9,7 +9,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.cpus = 2 vb.cpus = 2
end end
config.vm.provision "shell", path: "provision.sh" config.vm.provision "shell", path: "install.sh"
end end
Vagrant::Config.run do |config| Vagrant::Config.run do |config|

View file

@ -63,6 +63,9 @@ class Wiki():
self.path = path self.path = path
def __repr__(self):
return "Wiki: %s" % self.path
def revert_page(self, name, commit_sha, message, username): def revert_page(self, name, commit_sha, message, username):
page = self.get_page(name, commit_sha) page = self.get_page(name, commit_sha)
if not page: if not page:
@ -126,7 +129,7 @@ class Wiki():
message=message, message=message,
files=[filename]) files=[filename])
cache.delete_memoized(Wiki.get_page, cname) cache.delete(cname)
return ret return ret
@ -137,11 +140,13 @@ class Wiki():
email=self.default_committer_email, email=self.default_committer_email,
message="Moving %s to %s" % (old_name, new_name), message="Moving %s to %s" % (old_name, new_name),
files=[old_name]) files=[old_name])
cache.delete_memoized(Wiki.get_page, old_name) cache.delete_many(old_name, new_name)
cache.delete_memoized(Wiki.get_page, new_name)
@cache.memoize()
def get_page(self, name, sha='HEAD'): def get_page(self, name, sha='HEAD'):
cached = cache.get(name)
if cached:
return cached
# commit = gittle.utils.git.commit_info(self.repo[sha]) # commit = gittle.utils.git.commit_info(self.repo[sha])
name = self.cname_to_filename(name).encode('latin-1') name = self.cname_to_filename(name).encode('latin-1')
sha = sha.encode('latin-1') sha = sha.encode('latin-1')