Show More
@@ -23,6 +23,20 b' def loaditer(f):' | |||
|
23 | 23 | except EOFError: |
|
24 | 24 | pass |
|
25 | 25 | |
|
26 | def decodefilename(filename): | |
|
27 | """Perforce escapes special characters @, #, *, or % | |
|
28 | with %40, %23, %2A, or %25 respectively | |
|
29 | ||
|
30 | >>> decodefilename('portable-net45%252Bnetcore45%252Bwp8%252BMonoAndroid') | |
|
31 | 'portable-net45%2Bnetcore45%2Bwp8%2BMonoAndroid' | |
|
32 | >>> decodefilename('//Depot/Directory/%2525/%2523/%23%40.%2A') | |
|
33 | '//Depot/Directory/%25/%23/#@.*' | |
|
34 | """ | |
|
35 | replacements = [('%2A', '*'), ('%23', '#'), ('%40', '@'), ('%25', '%')] | |
|
36 | for k, v in replacements: | |
|
37 | filename = filename.replace(k, v) | |
|
38 | return filename | |
|
39 | ||
|
26 | 40 | class p4_source(converter_source): |
|
27 | 41 | def __init__(self, ui, path, revs=None): |
|
28 | 42 | super(p4_source, self).__init__(ui, path, revs=revs) |
@@ -138,7 +152,7 b' class p4_source(converter_source):' | |||
|
138 | 152 | filename = None |
|
139 | 153 | for v in vieworder: |
|
140 | 154 | if oldname.lower().startswith(v.lower()): |
|
141 | filename = views[v] + oldname[len(v):] | |
|
155 | filename = decodefilename(views[v] + oldname[len(v):]) | |
|
142 | 156 | break |
|
143 | 157 | if filename: |
|
144 | 158 | files.append((filename, d["rev%d" % i])) |
General Comments 0
You need to be logged in to leave comments.
Login now