changeset 2884:fcdcf0c19998

add default values to arguments of walk etc.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Sun, 13 Aug 2006 17:03:03 -0700
parents c2932ad5476a
children bd29a3067b97
files mercurial/cmdutil.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sun Aug 13 16:57:45 2006 -0700
+++ b/mercurial/cmdutil.py	Sun Aug 13 17:03:03 2006 -0700
@@ -77,7 +77,7 @@
     return util.cmdmatcher(repo.root, cwd, pats or ['.'], opts.get('include'),
                            opts.get('exclude'), head)
 
-def makewalk(repo, pats, opts, node=None, head='', badmatch=None):
+def makewalk(repo, pats=[], opts={}, node=None, head='', badmatch=None):
     files, matchfn, anypats = matchpats(repo, pats, opts, head)
     exact = dict(zip(files, files))
     def walk():
@@ -86,12 +86,12 @@
             yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact
     return files, matchfn, walk()
 
-def walk(repo, pats, opts, node=None, head='', badmatch=None):
+def walk(repo, pats=[], opts={}, node=None, head='', badmatch=None):
     files, matchfn, results = makewalk(repo, pats, opts, node, head, badmatch)
     for r in results:
         yield r
 
-def addremove(repo, pats, opts={}, wlock=None, dry_run=None):
+def addremove(repo, pats=[], opts={}, wlock=None, dry_run=None):
     if dry_run is None:
         dry_run = opts.get('dry_run')
     add, remove = [], []