# HG changeset patch # User Benoit Boissinot # Date 1268434953 -3600 # Node ID c4859aad198006d87a2ba64b852ff277948637f8 # Parent 24555e216af6fa11cfb36ec9301f6b5b74a89445 mq: all_files can be a set, remove dangerous default values diff -r 24555e216af6 -r c4859aad1980 hgext/mq.py --- a/hgext/mq.py Fri Mar 12 00:50:41 2010 +0100 +++ b/hgext/mq.py Sat Mar 13 00:02:33 2010 +0100 @@ -616,7 +616,7 @@ return (True, files, fuzz) def apply(self, repo, series, list=False, update_status=True, - strict=False, patchdir=None, merge=None, all_files={}): + strict=False, patchdir=None, merge=None, all_files=None): wlock = lock = tr = None try: wlock = repo.wlock() @@ -641,7 +641,7 @@ self.removeundo(repo) def _apply(self, repo, series, list=False, update_status=True, - strict=False, patchdir=None, merge=None, all_files={}): + strict=False, patchdir=None, merge=None, all_files=None): '''returns (error, hash) error = 1 for unable to read, 2 for patch failed, 3 for patch fuzz''' # TODO unify with commands.py @@ -674,7 +674,8 @@ if ph.haspatch: (patcherr, files, fuzz) = self.patch(repo, pf) - all_files.update(files) + if all_files is not None: + all_files.update(files) patcherr = not patcherr else: self.ui.warn(_("patch %s is empty\n") % patchname) @@ -1071,7 +1072,7 @@ end = self.series.index(patch, start) + 1 s = self.series[start:end] - all_files = {} + all_files = set() try: if mergeq: ret = self.mergepatch(repo, mergeq, s, diffopts)