diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -423,7 +423,7 @@ oldquiet = repo.ui.quiet repo.ui.quiet = True matcher = scmutil.match(repo[None]) - timer(lambda: scmutil.addremove(repo, matcher, "", dry_run=True)) + timer(lambda: scmutil.addremove(repo, matcher, "", opts)) finally: repo.ui.quiet = oldquiet fm.end() diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1214,12 +1214,11 @@ finally: repo.lfstatus = False -def scmutiladdremove(orig, repo, matcher, prefix, opts=None, dry_run=None, - similarity=None): +def scmutiladdremove(orig, repo, matcher, prefix, opts=None): if opts is None: opts = {} if not lfutil.islfilesrepo(repo): - return orig(repo, matcher, prefix, opts, dry_run, similarity) + return orig(repo, matcher, prefix, opts) # Get the list of missing largefiles so we can remove them lfdirstate = lfutil.openlfdirstate(repo.ui, repo) unsure, s = lfdirstate.status(matchmod.always(repo.root, repo.getcwd()), @@ -1250,7 +1249,7 @@ # function to take care of the rest. Make sure it doesn't do anything with # largefiles by passing a matcher that will ignore them. matcher = composenormalfilematcher(matcher, repo[None].manifest(), added) - return orig(repo, matcher, prefix, opts, dry_run, similarity) + return orig(repo, matcher, prefix, opts) # Calling purge with --all will cause the largefiles to be deleted. # Override repo.status to prevent this from happening. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -253,8 +253,9 @@ raise error.Abort(_('similarity must be a number')) if sim < 0 or sim > 100: raise error.Abort(_('similarity must be between 0 and 100')) + opts['similarity'] = sim / 100.0 matcher = scmutil.match(repo[None], pats, opts) - return scmutil.addremove(repo, matcher, "", opts, similarity=sim / 100.0) + return scmutil.addremove(repo, matcher, "", opts) @command('^annotate|blame', [('r', 'rev', '', _('annotate the specified revision'), _('REV')), diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -731,14 +731,12 @@ if tostrip: repair.delayedstrip(repo.ui, repo, tostrip, operation) -def addremove(repo, matcher, prefix, opts=None, dry_run=None, similarity=None): +def addremove(repo, matcher, prefix, opts=None): if opts is None: opts = {} m = matcher - if dry_run is None: - dry_run = opts.get('dry_run') - if similarity is None: - similarity = float(opts.get('similarity') or 0) + dry_run = opts.get('dry_run') + similarity = float(opts.get('similarity') or 0) ret = 0 join = lambda f: os.path.join(prefix, f) @@ -749,7 +747,7 @@ if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()): sub = wctx.sub(subpath) try: - if sub.addremove(submatch, prefix, opts, dry_run, similarity): + if sub.addremove(submatch, prefix, opts): ret = 1 except error.LookupError: repo.ui.status(_("skipping missing subrepository: %s\n") diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -287,7 +287,7 @@ def add(self, ui, match, prefix, explicitonly, **opts): return [] - def addremove(self, matcher, prefix, opts, dry_run, similarity): + def addremove(self, matcher, prefix, opts): self.ui.warn("%s: %s" % (prefix, _("addremove is not supported"))) return 1 @@ -510,15 +510,14 @@ explicitonly, **opts) @annotatesubrepoerror - def addremove(self, m, prefix, opts, dry_run, similarity): + def addremove(self, m, prefix, opts): # In the same way as sub directories are processed, once in a subrepo, # always entry any of its subrepos. Don't corrupt the options that will # be used to process sibling subrepos however. opts = copy.copy(opts) opts['subrepos'] = True return scmutil.addremove(self._repo, m, - self.wvfs.reljoin(prefix, self._path), opts, - dry_run, similarity) + self.wvfs.reljoin(prefix, self._path), opts) @annotatesubrepoerror def cat(self, match, fm, fntemplate, prefix, **opts):