mercurial/narrowspec.py
changeset 44563 1922694d638f
parent 43117 8ff1ecfadcd1
child 44856 b7808443ed6a
equal deleted inserted replaced
44562:ece43c79333e 44563:1922694d638f
   231     :param req_includes: requested includes
   231     :param req_includes: requested includes
   232     :param req_excludes: requested excludes
   232     :param req_excludes: requested excludes
   233     :param repo_includes: repo includes
   233     :param repo_includes: repo includes
   234     :param repo_excludes: repo excludes
   234     :param repo_excludes: repo excludes
   235     :return: include patterns, exclude patterns, and invalid include patterns.
   235     :return: include patterns, exclude patterns, and invalid include patterns.
   236 
       
   237     >>> restrictpatterns({'f1','f2'}, {}, ['f1'], [])
       
   238     (set(['f1']), {}, [])
       
   239     >>> restrictpatterns({'f1'}, {}, ['f1','f2'], [])
       
   240     (set(['f1']), {}, [])
       
   241     >>> restrictpatterns({'f1/fc1', 'f3/fc3'}, {}, ['f1','f2'], [])
       
   242     (set(['f1/fc1']), {}, [])
       
   243     >>> restrictpatterns({'f1_fc1'}, {}, ['f1','f2'], [])
       
   244     ([], set(['path:.']), [])
       
   245     >>> restrictpatterns({'f1/../f2/fc2'}, {}, ['f1','f2'], [])
       
   246     (set(['f2/fc2']), {}, [])
       
   247     >>> restrictpatterns({'f1/../f3/fc3'}, {}, ['f1','f2'], [])
       
   248     ([], set(['path:.']), [])
       
   249     >>> restrictpatterns({'f1/$non_exitent_var'}, {}, ['f1','f2'], [])
       
   250     (set(['f1/$non_exitent_var']), {}, [])
       
   251     """
   236     """
   252     res_excludes = set(req_excludes)
   237     res_excludes = set(req_excludes)
   253     res_excludes.update(repo_excludes)
   238     res_excludes.update(repo_excludes)
   254     invalid_includes = []
   239     invalid_includes = []
   255     if not req_includes:
   240     if not req_includes: