comparison mercurial/util.py @ 7820:346fafc144fc

audit: be even pickier (issue1450)
author Matt Mackall <mpm@selenic.com>
date Wed, 04 Mar 2009 17:02:16 -0600
parents 8a217626bb0c
children bc027d72c289
comparison
equal deleted inserted replaced
7819:14b703252f14 7820:346fafc144fc
820 or os.pardir in parts): 820 or os.pardir in parts):
821 raise Abort(_("path contains illegal component: %s") % path) 821 raise Abort(_("path contains illegal component: %s") % path)
822 if '.hg' in path.lower(): 822 if '.hg' in path.lower():
823 lparts = [p.lower() for p in parts] 823 lparts = [p.lower() for p in parts]
824 for p in '.hg', '.hg.': 824 for p in '.hg', '.hg.':
825 if p in lparts[1:-1]: 825 if p in lparts[1:]:
826 pos = lparts.index(p) 826 pos = lparts.index(p)
827 base = os.path.join(*parts[:pos]) 827 base = os.path.join(*parts[:pos])
828 raise Abort(_('path %r is inside repo %r') % (path, base)) 828 raise Abort(_('path %r is inside repo %r') % (path, base))
829 def check(prefix): 829 def check(prefix):
830 curpath = os.path.join(self.root, prefix) 830 curpath = os.path.join(self.root, prefix)