Fixed up path limitation issue with p4.

This commit is contained in:
unknown 2015-06-08 14:50:07 -06:00
parent a5f82d5e00
commit d5dc8155f5
4 changed files with 80 additions and 3 deletions

View file

@ -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