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':
+ cur_content = cur_content[:-1]
if cur_content != rv['content']:
status[os.path.relpath(full, self.root)] = 'U'
return status
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':
+ cur_content = cur_content[:-1]
newname = 'b/%s (working copy)' % filename
new = [i+'\n' for i in cur_content.split('\n')]
else:
diff_fd = StringIO()
bzrlib.diff.internal_diff(oldname, old, newname, new, diff_fd)
diff_fd.seek(0)
- return diff_fd.read()
+ diff = diff_fd.read()
+ if diff[-1] == '\n':
+ diff = diff[:-1]
+ return diff