diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-01-02 12:15:25 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-01-02 12:15:25 +0000 |
commit | 28880c7d432b1e471e2bd3d7e7d0d5ff414b2e03 (patch) | |
tree | c3661384abdda363bdc5296c1b3ef2f7be02e7f9 /lib | |
parent | 04d04d8429d4c7aaf3604e2006aa86258bc5ba15 (diff) | |
download | gitano-28880c7d432b1e471e2bd3d7e7d0d5ff414b2e03.tar.gz |
Remove README support from repository
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitano/repository.lua | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua index 410a35f..84cc747 100644 --- a/lib/gitano/repository.lua +++ b/lib/gitano/repository.lua @@ -252,26 +252,6 @@ function repo_method:check_local_git_files() log.warn(i18n.expand("ERROR_UNABLE_TO_WRITE_FILE", {what="description", reason=tostring(err)})) end - -- And now our readme if we have one - if self.readme_html then - local fh, err = sio.open(self:fs_path() .. ("/README.html.%d.new"):format(luxio.getpid()), "wc") - if fh then - fh:write(self.readme_html) - fh:close() - local ok, errno = luxio.rename(self:fs_path() .. ("/README.html.%d.new"):format(luxio.getpid()), - self:fs_path() .. "/README.html") - if ok ~= 0 then - log.warn(i18n.expand("ERROR_UNABLE_TO_RENAME_INTO_PLACE", - {what="README.html", reason=luxio.strerror(errno)})) - end - else - log.warn(i18n.expand("ERROR_UNABLE_TO_WRITE_FILE", - {what="README.html", reason=tostring(err)})) - end - else - -- Remove any readme (and ignore errors) - luxio.unlink(self:fs_path() .. "/README.html") - end -- Check that our HEAD is correctly configured local our_head = self:conf_get "project.head" if self.git.HEAD ~= our_head then @@ -404,18 +384,6 @@ function repo_method:validate_admin_sha(sha) conf.settings["project.head"] = "refs/heads/master" end - if is_blob(tree["README.mdwn"]) then - local mdwn_src = tree["README.mdwn"].obj.content - local ok, res = pcall(markdown.convert_to_html, mdwn_src) - if ok then - ret.readme_html = res - ret.readme_mdwn = mdwn_src - else - log.warn(i18n.expand("WARN_MARKDOWN_ERROR", {name=self.name, - reason=res})) - end - end - -- Generate a Lace for the project at this ref local lace, msg = lace.compile(self, sha) if not lace then @@ -485,19 +453,6 @@ function repo_method:conf_set_and_save(conf, newvalue, author, committer) return true end -function repo_method:set_readme(newreadme, author, committer) - local oldreadme = self.readme_mdwn - self.readme_mdwn = newreadme - local ok, msg = self:save_admin(i18n.expand("MSG_CHANGING_README"), - author, committer) - if not ok then - self.readme_mdwn = oldreadme - return nil, msg - end - log.state(i18n.expand("MSG_CHANGED_README", {name=self.name})) - return true -end - function repo_method:set_head(newhead, author, committer) if not newhead:match("^refs/") then newhead = "refs/heads/" .. newhead @@ -708,14 +663,6 @@ function repo_method:save_admin(reason, author, committer) flat_tree["project.conf"] = conf_blob - if self.readme_mdwn then - local readme_blob, msg = gall.object.create(self.git, "blob", self.readme_mdwn) - if not readme_blob then - return nil, msg - end - flat_tree["README.mdwn"] = readme_blob - end - local tree, msg = gall.tree.create(self.git, flat_tree) if not tree then return nil, msg |