# HG changeset patch # User Vadim Gelfer # Date 1155513813 25200 # Node ID bd29a3067b97ec4c28a46dc634ad6cbcb440e11b # Parent fcdcf0c19998d5f88b231b1216890f14d339cbc0 cmdutil.matchpats: allow include/exclude to be optional. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -71,8 +71,10 @@ def make_file(repo, pat, node=None, def matchpats(repo, pats=[], opts={}, head=''): cwd = repo.getcwd() if not pats and cwd: - opts['include'] = [os.path.join(cwd, i) for i in opts['include']] - opts['exclude'] = [os.path.join(cwd, x) for x in opts['exclude']] + opts['include'] = [os.path.join(cwd, i) + for i in opts.get('include', [])] + opts['exclude'] = [os.path.join(cwd, x) + for x in opts.get('exclude', [])] cwd = '' return util.cmdmatcher(repo.root, cwd, pats or ['.'], opts.get('include'), opts.get('exclude'), head)