# HG changeset patch # User Thomas Arendsen Hein # Date 1151389863 -7200 # Node ID 37655f10ced6092fac2dcb911c9cde100ea54ac8 # Parent 18cf95ad3666585dc7b9340a692c1b9ce21344ca Don't require opts['dry_run'] to be set to fix external tools like tailor. diff -r 18cf95ad3666 -r 37655f10ced6 mercurial/commands.py --- a/mercurial/commands.py Mon Jun 26 22:44:48 2006 +0200 +++ b/mercurial/commands.py Tue Jun 27 08:31:03 2006 +0200 @@ -650,7 +650,7 @@ elif repo.dirstate.state(abs) == '?': ui.status(_('adding %s\n') % rel) names.append(abs) - if not opts['dry_run']: + if not opts.get('dry_run'): repo.add(names) def addremove(ui, repo, *pats, **opts): @@ -1076,21 +1076,21 @@ ui.warn(_('%s: not overwriting - file exists\n') % reltarget) return - if not opts['after'] and not opts['dry_run']: + if not opts['after'] and not opts.get('dry_run'): os.unlink(reltarget) if opts['after']: if not os.path.exists(reltarget): return else: targetdir = os.path.dirname(reltarget) or '.' - if not os.path.isdir(targetdir) and not opts['dry_run']: + if not os.path.isdir(targetdir) and not opts.get('dry_run'): os.makedirs(targetdir) try: restore = repo.dirstate.state(abstarget) == 'r' - if restore and not opts['dry_run']: + if restore and not opts.get('dry_run'): repo.undelete([abstarget], wlock) try: - if not opts['dry_run']: + if not opts.get('dry_run'): shutil.copyfile(relsrc, reltarget) shutil.copymode(relsrc, reltarget) restore = False @@ -1110,7 +1110,7 @@ if ui.verbose or not exact: ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) targets[abstarget] = abssrc - if abstarget != origsrc and not opts['dry_run']: + if abstarget != origsrc and not opts.get('dry_run'): repo.copy(origsrc, abstarget, wlock) copied.append((abssrc, relsrc, exact)) @@ -2334,7 +2334,7 @@ if ui.verbose or not exact: ui.status(_('removing %s\n') % rel) names.append(abs) - if not opts['dry_run']: + if not opts.get('dry_run'): repo.remove(names, True, wlock) return errs