Mercurial > hg
comparison mercurial/util.py @ 13974:23f2736abce3
move checkfilename from util to scmutil
checkfilename is specific to Mercurial, since it contains the knowledege
that Mercurial can't track files with \n or \r in the name.
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Thu, 21 Apr 2011 13:18:52 +0200 |
parents | d1f4e7fd970a |
children | 938fbeacac84 |
comparison
equal
deleted
inserted
replaced
13973:366fa83f9820 | 13974:23f2736abce3 |
---|---|
443 shutil.copy(src, dst) | 443 shutil.copy(src, dst) |
444 num += 1 | 444 num += 1 |
445 | 445 |
446 return hardlink, num | 446 return hardlink, num |
447 | 447 |
448 def checkfilename(f): | |
449 '''Check that the filename f is an acceptable filename for a tracked file''' | |
450 if '\r' in f or '\n' in f: | |
451 raise Abort(_("'\\n' and '\\r' disallowed in filenames: %r") % f) | |
452 | |
453 _windows_reserved_filenames = '''con prn aux nul | 448 _windows_reserved_filenames = '''con prn aux nul |
454 com1 com2 com3 com4 com5 com6 com7 com8 com9 | 449 com1 com2 com3 com4 com5 com6 com7 com8 com9 |
455 lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split() | 450 lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split() |
456 _windows_reserved_chars = ':*?"<>|' | 451 _windows_reserved_chars = ':*?"<>|' |
457 def checkwinfilename(path): | 452 def checkwinfilename(path): |