comparison mercurial/archival.py @ 5842:111ed8c871bf

Use util.normpath() instead of direct path string operation. This change is intended to allow hooking normpath() by win32mbcs extension for MBCS support.
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Wed, 09 Jan 2008 21:30:13 +0900
parents 667290b6c95e
children 20b05618b3e2
comparison
equal deleted inserted replaced
5841:07ca22a72dcc 5842:111ed8c871bf
13 def tidyprefix(dest, prefix, suffixes): 13 def tidyprefix(dest, prefix, suffixes):
14 '''choose prefix to use for names in archive. make sure prefix is 14 '''choose prefix to use for names in archive. make sure prefix is
15 safe for consumers.''' 15 safe for consumers.'''
16 16
17 if prefix: 17 if prefix:
18 prefix = prefix.replace('\\', '/') 18 prefix = util.normpath(prefix)
19 else: 19 else:
20 if not isinstance(dest, str): 20 if not isinstance(dest, str):
21 raise ValueError('dest must be string if no prefix') 21 raise ValueError('dest must be string if no prefix')
22 prefix = os.path.basename(dest) 22 prefix = os.path.basename(dest)
23 lower = prefix.lower() 23 lower = prefix.lower()