##// END OF EJS Templates
diffs: handle paths with quotes in diffs.
dan -
r3826:ab69d1e3 stable
parent child Browse files
Show More
@@ -0,0 +1,7 b''
1 diff --git "a/\"><img src=x onerror=prompt(0)>/\"><img src=x onerror=prompt(1)>.txt" "b/\"><img src=x onerror=prompt(0)>/\"><img src=x onerror=prompt(1)>.txt"
2 index e69de29..8eb97de 100644
3 --- "a/\"><img src=x onerror=prompt(0)>/\"><img src=x onerror=prompt(1)>.txt"
4 +++ "b/\"><img src=x onerror=prompt(0)>/\"><img src=x onerror=prompt(1)>.txt"
5 @@ -0,0 +1 @@
6 +Ehlo eglo
7 \ No newline at end of file
@@ -44,6 +44,6 b' class GitDiff(base.Diff):'
44 44 (?:^index[ ](?P<a_blob_id>[0-9A-Fa-f]+)
45 45 \.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
46 46 (?:^(?P<bin_patch>GIT[ ]binary[ ]patch)(?:\n|$))?
47 (?:^---[ ](a/(?P<a_file>.+)|/dev/null)(?:\n|$))?
48 (?:^\+\+\+[ ](b/(?P<b_file>.+)|/dev/null)(?:\n|$))?
47 (?:^---[ ]("?a/(?P<a_file>.+)|/dev/null)(?:\n|$))?
48 (?:^\+\+\+[ ]("?b/(?P<b_file>.+)|/dev/null)(?:\n|$))?
49 49 """, re.VERBOSE | re.MULTILINE)
@@ -19,7 +19,7 b''
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 21 """
22 GIT diff module
22 HG diff module
23 23 """
24 24
25 25 import re
@@ -44,6 +44,6 b' class MercurialDiff(base.Diff):'
44 44 (?:^index[ ](?P<a_blob_id>[0-9A-Fa-f]+)
45 45 \.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
46 46 (?:^(?P<bin_patch>GIT[ ]binary[ ]patch)(?:\n|$))?
47 (?:^---[ ](a/(?P<a_file>.+)|/dev/null)(?:\n|$))?
48 (?:^\+\+\+[ ](b/(?P<b_file>.+)|/dev/null)(?:\n|$))?
47 (?:^---[ ]("?a/(?P<a_file>.+)|/dev/null)(?:\n|$))?
48 (?:^\+\+\+[ ]("?b/(?P<b_file>.+)|/dev/null)(?:\n|$))?
49 49 """, re.VERBOSE | re.MULTILINE)
@@ -18,7 +18,6 b''
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21
22 21 """
23 22 SVN diff module
24 23 """
@@ -47,6 +46,6 b' class SubversionDiff(base.Diff):'
47 46 (?:^index[ ](?P<a_blob_id>[0-9A-Fa-f]+)
48 47 \.\.(?P<b_blob_id>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))?
49 48 (?:^(?P<bin_patch>GIT[ ]binary[ ]patch)(?:\n|$))?
50 (?:^---[ ](a/(?P<a_file>.+)|/dev/null)\t\(revision[ ]\d+\)(?:\n|$))?
51 (?:^\+\+\+[ ](b/(?P<b_file>.+)|/dev/null)\t\(revision[ ]\d+\)(?:\n|$))?
49 (?:^---[ ]("?a/(?P<a_file>.+)|/dev/null)\t\(revision[ ]\d+\)(?:\n|$))?
50 (?:^\+\+\+[ ]("?b/(?P<b_file>.+)|/dev/null)\t\(revision[ ]\d+\)(?:\n|$))?
52 51 """, re.VERBOSE | re.MULTILINE)
@@ -343,6 +343,14 b' DIFF_FIXTURES = ['
343 343 'ops': {CHMOD_FILENODE: 'modified file chmod 100644 => 100755'}})
344 344 ]),
345 345 ('git',
346 'git_diff_js_chars.diff',
347 [('\\"><img src=x onerror=prompt(0)>/\\"><img src=x onerror=prompt(1)>.txt', 'M',
348 {'added': 1,
349 'deleted': 0,
350 'binary': False,
351 'ops': {MOD_FILENODE: 'modified file'}})
352 ]),
353 ('git',
346 354 'git_diff_rename_file.diff',
347 355 [('file.xls', 'M',
348 356 {'added': 0,
General Comments 0
You need to be logged in to leave comments. Login now