Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 5843:83c354c4d529
Add endswithsep() and use it instead of using os.sep and os.altsep directly.
This change is intended to allow hooking endswithsep() by win32mbcs
extension for MBCS support.
author | Shun-ichi GOTO <shunichi.goto@gmail.com> |
---|---|
date | Wed, 09 Jan 2008 21:30:35 +0900 |
parents | c5c9a022bd9a |
children | d0576d065993 |
comparison
equal
deleted
inserted
replaced
5842:111ed8c871bf | 5843:83c354c4d529 |
---|---|
460 destdirexists = os.path.isdir(dest) | 460 destdirexists = os.path.isdir(dest) |
461 if not destdirexists: | 461 if not destdirexists: |
462 if len(pats) > 1 or util.patkind(pats[0], None)[0]: | 462 if len(pats) > 1 or util.patkind(pats[0], None)[0]: |
463 raise util.Abort(_('with multiple sources, destination must be an ' | 463 raise util.Abort(_('with multiple sources, destination must be an ' |
464 'existing directory')) | 464 'existing directory')) |
465 if dest.endswith(os.sep) or os.altsep and dest.endswith(os.altsep): | 465 if util.endswithsep(dest): |
466 raise util.Abort(_('destination %s is not a directory') % dest) | 466 raise util.Abort(_('destination %s is not a directory') % dest) |
467 | 467 |
468 tfn = targetpathfn | 468 tfn = targetpathfn |
469 if after: | 469 if after: |
470 tfn = targetpathafterfn | 470 tfn = targetpathafterfn |