From 09b5f67a8739349f30bbeff13aeb475131850244 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Mon, 3 Nov 2008 11:51:26 +0000 Subject: [PATCH] Support changelog message The user can modify the git commit message through an input box on the edit page. The original behavour is preserved by defualting the input box to the original commit mesage. This crosses off item 3 from http://codewiz.org/wiki/GeekiGeekiToDo. Signed-off-by: Joel Stanley --- geekigeeki.py | 14 ++++++++------ post_edit_hook.sh | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index 64333ea..7943503 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -246,9 +246,9 @@ def handle_edit(pagename): pg = Page(pagename) if 'save' in form: if form['file'].value: - pg.save(form['file'].file.read()) + pg.save(form['file'].file.read(), form['changelog'].value) else: - pg.save(form['savetext'].value.replace('\r\n', '\n')) + pg.save(form['savetext'].value.replace('\r\n', '\n'), form['changelog'].value) pg.format() elif 'cancel' in form: pg.msg_text = 'Editing canceled' @@ -704,8 +704,9 @@ class Page: -
- """ +
""" + print "Changelog: " % self.page_name + print"" print "

" + Page('EditingTips').link_to() + "

" if preview: print "
" @@ -743,7 +744,7 @@ class Page: if er.errno != errno.ENOENT: raise er os.rename(tmp_filename, name) - def save(self, newdata): + def save(self, newdata, changelog): if not self.can_write(): self.msg_text = 'Write access denied by ACLs' self.msg_type = 'error' @@ -756,7 +757,8 @@ class Page: cmd = ( post_edit_hook + " '" + data_dir + '/' + self.page_name + "' '" + remote_user() - + "' '" + remote_host() + "'" + + "' '" + remote_host() + + "' '" + changelog + "'" ) out = os.popen(cmd) output = out.read() diff --git a/post_edit_hook.sh b/post_edit_hook.sh index fca8e24..2c06f19 100755 --- a/post_edit_hook.sh +++ b/post_edit_hook.sh @@ -4,7 +4,7 @@ set -e exec 2>&1 -if [ $# -ne 3 ]; then +if [ $# -ne 4 ]; then echo "Usage $0 " exit 1 fi @@ -17,4 +17,4 @@ git-add $file # In case it's a new page GIT_COMMITTER_NAME='GeekiGeeki' \ GIT_COMMITTER_EMAIL='webmaster@codewiz.org' \ -git-commit -a -m "Edit page $file" --author="$2 <$2@$3>" +git commit -a -m "$4" --author="$2 <$2@$3>" -- 2.25.1