> +def purge(repo, dirs=None, ignored=False, removeemptydirs=True, > + removefiles=True, abortonerror=False, include=None, exclude=None, > + noop=False):
Nit: can't we pass in matcher instead of (dirs, include, exclude)? > + if removefiles: > + for f in sorted(status.unknown + status.ignored): > + if not noop: > + repo.ui.note(_('removing file %s\n') % f) > + remove(util.unlink, f) > + yield f > + > + if removeemptydirs: > + for f in sorted(directories, reverse=True): > + if match(f) and not os.listdir(repo.wvfs.join(f)): > + if not noop: > + repo.ui.note(_('removing directory %s\n') % f) > + remove(os.rmdir, f) > + yield f This means `mergemod.purge()` itself does nothing unless the return value is fully consumed. That's IMHO a bad API. > + paths = mergemod.purge( > + repo, dirs, ignored=opts.get('all', False), > + removeemptydirs=removedirs, removefiles=removefiles, > + abortonerror=opts.get('abort_on_err'), > + include=opts.get('include'), exclude=opts.get('exclude'), > + noop=opts.get('print') or opts.get('print0')) Nit: perhaps `noop=not act`? _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel