# HG changeset patch # User mpm@selenic.com # Date 1124051016 28800 # Node ID fe30f5434b5152e14638c1039d8c8b48113d2ecf # Parent 01215ad0428341bf0b5806b199c54fe158d9affd Fix bug with empty inc and exc This fixes an exception that showed up when importing patches diff -r 01215ad04283 -r fe30f5434b51 mercurial/util.py --- a/mercurial/util.py Sat Aug 13 19:43:42 2005 -0800 +++ b/mercurial/util.py Sun Aug 14 12:23:36 2005 -0800 @@ -92,7 +92,7 @@ return '' else: raise Abort('%s not under repository root' % myname) - + def matcher(repo, cwd, names, inc, exc, head = ''): def patkind(name): for prefix in 're:', 'glob:', 'path:', 'relpath:': @@ -141,11 +141,15 @@ elif kind == 'relpath': files.append((kind, name)) roots.append(name) - + patmatch = matchfn(pats, '$') or always filematch = matchfn(files, '(?:/|$)') or always - incmatch = matchfn(map(patkind, inc), '(?:/|$)') or always - excmatch = matchfn(map(patkind, exc), '(?:/|$)') or (lambda fn: False) + incmatch = always + if inc: + incmatch = matchfn(map(patkind, inc), '(?:/|$)') + excmatch = lambda fn: False + if exc: + excmatch = matchfn(map(patkind, exc), '(?:/|$)') return roots, lambda fn: (incmatch(fn) and not excmatch(fn) and (fn.endswith('/') or