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'
<input type="submit" name="preview" value="Preview" />
<input type="reset" value="Reset" />
<input type="submit" name="cancel" value="Cancel" />
- <br />
- </form></div>"""
+ <br />"""
+ print "Changelog: <input type=\"input\" name=\"changelog\" value=\"Edit page %s\"/>" % self.page_name
+ print"</form></div>"
print "<p>" + Page('EditingTips').link_to() + "</p>"
if preview:
print "<div class='preview'>"
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'
cmd = ( post_edit_hook
+ " '" + data_dir + '/' + self.page_name
+ "' '" + remote_user()
- + "' '" + remote_host() + "'"
+ + "' '" + remote_host()
+ + "' '" + changelog + "'"
)
out = os.popen(cmd)
output = out.read()
set -e
exec 2>&1
-if [ $# -ne 3 ]; then
+if [ $# -ne 4 ]; then
echo "Usage $0 <path-to-commit> <remote-user> <remote-host>"
exit 1
fi
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>"