projects
/
mw
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
af5f9b4
)
fixing a bug when a page is blanked
author
keby
<keby@erebor.(none)>
Thu, 20 May 2010 20:53:29 +0000
(22:53 +0200)
committer
keby
<keby@erebor.(none)>
Thu, 20 May 2010 20:53:29 +0000
(22:53 +0200)
src/mw/clicommands.py
patch
|
blob
|
history
src/mw/metadir.py
patch
|
blob
|
history
diff --git
a/src/mw/clicommands.py
b/src/mw/clicommands.py
index 4ecafb0d9aef17e6f2678021b3f2e18d2d0c52c0..6db3cb800f12c381d0eb539a2a92c4269923ada4 100644
(file)
--- a/
src/mw/clicommands.py
+++ b/
src/mw/clicommands.py
@@
-232,7
+232,7
@@
class CommitCommand(CommandBase):
filename = os.path.join(self.metadir.root, file)
text = codecs.open(filename, 'r', 'utf-8').read()
text = text.encode('utf-8')
filename = os.path.join(self.metadir.root, file)
text = codecs.open(filename, 'r', 'utf-8').read()
text = text.encode('utf-8')
- if
text[-1] == '\n'
:
+ if
(len(text) != 0) and (text[-1] == '\n')
:
text = text[:-1]
md5 = hashlib.md5()
md5.update(text)
text = text[:-1]
md5 = hashlib.md5()
md5.update(text)
diff --git
a/src/mw/metadir.py
b/src/mw/metadir.py
index 295481901682441c55276068db16d605f7f53f30..9aae09146c7154aaf2647fa9b5d34218687263d8 100644
(file)
--- a/
src/mw/metadir.py
+++ b/
src/mw/metadir.py
@@
-155,7
+155,7
@@
class Metadir(object):
rvid = self.pages_get_rv_list(pageid)[-1]
rv = self.pages_get_rv(pageid, rvid)
cur_content = codecs.open(full, 'r', 'utf-8').read()
rvid = self.pages_get_rv_list(pageid)[-1]
rv = self.pages_get_rv(pageid, rvid)
cur_content = codecs.open(full, 'r', 'utf-8').read()
- if
cur_content[-1] == '\n'
:
+ if
(len(cur_content) != 0) and (cur_content[-1] == '\n')
:
cur_content = cur_content[:-1]
if cur_content != rv['content']:
status[os.path.relpath(full, self.root)] = 'U'
cur_content = cur_content[:-1]
if cur_content != rv['content']:
status[os.path.relpath(full, self.root)] = 'U'
@@
-176,7
+176,7
@@
class Metadir(object):
old = [i + '\n' for i in oldrv['content'].split('\n')]
if newrvid == 0:
cur_content = codecs.open(filename, 'r', 'utf-8').read()
old = [i + '\n' for i in oldrv['content'].split('\n')]
if newrvid == 0:
cur_content = codecs.open(filename, 'r', 'utf-8').read()
- if
cur_content[-1] == '\n'
:
+ if
(len(cur_content) != 0) and (cur_content[-1] == '\n')
:
cur_content = cur_content[:-1]
newname = 'b/%s (working copy)' % filename
new = [i + '\n' for i in cur_content.split('\n')]
cur_content = cur_content[:-1]
newname = 'b/%s (working copy)' % filename
new = [i + '\n' for i in cur_content.split('\n')]
Benjamin Mako Hill
||
Want to submit a patch?