Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug where empty remote wiki page throws Invalid local_version e…

…xception.

Remote wiki may be empty, which causes the WikiPage to throw "Page not
modified" exception when saving. This will result an invalid
local_version ('0') which causes the synchronization to fail.
  • Loading branch information...
commit 7ab099cff33cffe8bf64cb71ba26cf1488b311ea 1 parent 2c27480
Ivan Choo authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 wikisync/plugin.py
View
5 wikisync/plugin.py
@@ -370,6 +370,11 @@ def _process_action(self, req):
wiki = WikiPage(self.env, item.name)
wiki.text = wc.pull(item.name,
item.remote_version)
+ if not len(wiki.text) and not wiki.version:
+ # BUGFIX: account for empy remote wiki Page,
+ # which throws a Page not modified exception when
+ # saving for the first time (default wiki.text = '')
+ wiki.text = " "
try:
wiki.save(author, DEFAULT_SIGNATURE, addr)
except TracError, e:
Please sign in to comment.
Something went wrong with that request. Please try again.