What's the URL of the page containing the problem?
http://localhost:8000/r/11/diff/#index_header
What steps will reproduce the problem?
1. Submit patch with new added files using post-review.py
2. Go to diff page
3. Notice that first two letters of the file name are cut off
What is the expected output? What do you see instead?
Expected:
-- quote --
Files Changed:
1. test.post: 1 change [ new content ]
-- endquote --
Saw:
-- quote --
Files Changed:
1. st.post: 1 change [ new content ]
-- endquote --
What operating system are you using? What browser?
Ubuntu 8.10
Firefox 3.0.5
Python 2.5.2 on server
Please provide any additional information below.
This patch fixes things:
Index: scmtools/git.py
===================================================================
--- scmtools/git.py (revision 1768)
+++ scmtools/git.py (working copy)
@@ -105,8 +105,9 @@
diffLine = self.lines[i].split()
try:
# Need to remove the "a/" and "b/" prefix
- file.origFile = diffLine[-2][2:]
- file.newFile = diffLine[-1][2:]
+ remPrefix = re.compile("^[a|b]/");
+ file.origFile = remPrefix.sub("", diffLine[-2])
+ file.newFile = remPrefix.sub("", diffLine[-1])
except ValueError:
raise DiffParserError(
"The diff file is missing revision information",