changeset 2510:cbff06469488

merge with crew.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Tue, 27 Jun 2006 00:13:44 -0700
parents 6350b01d173f (current diff) 37655f10ced6 (diff)
children 041d8f0a8437
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Jun 27 00:10:41 2006 -0700
+++ b/mercurial/commands.py	Tue Jun 27 00:13:44 2006 -0700
@@ -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))
 
@@ -2352,7 +2352,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