mercurial/narrowspec.py
branchstable
changeset 52718 1c83ebf78f74
parent 52717 a7669e7b0355
equal deleted inserted replaced
52717:a7669e7b0355 52718:1c83ebf78f74
    80 
    80 
    81     components = pat.split(b'/')
    81     components = pat.split(b'/')
    82     if b'.' in components or b'..' in components:
    82     if b'.' in components or b'..' in components:
    83         raise error.Abort(
    83         raise error.Abort(
    84             _(b'"." and ".." are not allowed in narrowspec paths')
    84             _(b'"." and ".." are not allowed in narrowspec paths')
       
    85         )
       
    86 
       
    87     if pat != b'' and b'' in components:
       
    88         raise error.Abort(
       
    89             _(b'empty path components are not allowed in narrowspec paths')
    85         )
    90         )
    86 
    91 
    87 
    92 
    88 def normalizepattern(pattern, defaultkind=b'path'):
    93 def normalizepattern(pattern, defaultkind=b'path'):
    89     """Returns the normalized version of a text-format pattern.
    94     """Returns the normalized version of a text-format pattern.