Fixed up path limitation issue with p4.
This commit is contained in:
parent
a5f82d5e00
commit
d5dc8155f5
4 changed files with 80 additions and 3 deletions
15
p4Helper.py
15
p4Helper.py
|
@ -57,6 +57,21 @@ def join( patha, pathb ):
|
|||
def splitdrive( path ):
|
||||
return ntpath.splitdrive( path )
|
||||
|
||||
def p4FriendlyPath(path):
|
||||
"""
|
||||
Returns path with sanitized unsupported characters due to filename limitations.
|
||||
"""
|
||||
# http://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html#1041962
|
||||
replace_items = {
|
||||
'@' : '%40',
|
||||
'#' : '%23',
|
||||
'*' : '%2A',
|
||||
'%' : '%25'
|
||||
}
|
||||
def replace(c):
|
||||
return replace_items[c] if c in replace_items else c
|
||||
return ''.join(map(replace, path))
|
||||
|
||||
#==============================================================
|
||||
def get_ignore_list( path, files_to_ignore ):
|
||||
# have to split path and test top directory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue