625: post-review: svn wrapper adds inappropriate newlines to some diffs

timw.a******@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 17, 2010
What's the URL of the page containing the problem?


What steps will reproduce the problem?
1. Ensure you have a file with spaces in your repository
2. Change that file and use post-review to post a diff of that file

What is the expected output?
The patch should be attached correctly.

What do you see instead?
Error uploading diff: One or more fields had errors (105)
>>> {u'fields': {u'path': [u'The diff file is empty']}, u'stat': u'fail',
u'err': {u'msg': u'One or more fields had errors', u'code': 105}}
Your review request still exists, but the diff is not attached.

What operating system are you using? What browser?
Linux (Ubuntu 8.04 32-bit), Firefox 3.0

Please provide any additional information below.
Using 'svn diff' to produce a patch and manually attaching the resulting
file leads to a successfully-attached patch in the above scenario.

When running 'post-review -n', I notice two things:
1. extra newlines appear after the 'Index:' line (which would break RB's
server-side diff parsing, based on my reading), and
2. revision numbers have newlines inserted before them:
--- file1
     (revision 1234)
+++ file1
     (working copy)
(where the leading spaces above are actually tabs)
Index: contrib/tools/post-review
===================================================================
--- contrib/tools/post-review	(revision 1477)
+++ contrib/tools/post-review	(working copy)
@@ -727,6 +727,7 @@
             parts = info.split(": ", 1)
             if len(parts) == 2:
                 key, value = parts
+                value = value.split('\n')[0]
                 svninfo[key] = value
 
         return svninfo
chipx86
#1 chipx86
  • +Confirmed
  • +Component-RBTools
    +Milestone-RBTools-Release1.0
david
#2 david
It looks like this shouldn't be a problem anymore.
  • -Confirmed
    +Fixed