Show More
@@ -650,7 +650,7 b' def add(ui, repo, *pats, **opts):' | |||||
650 | elif repo.dirstate.state(abs) == '?': |
|
650 | elif repo.dirstate.state(abs) == '?': | |
651 | ui.status(_('adding %s\n') % rel) |
|
651 | ui.status(_('adding %s\n') % rel) | |
652 | names.append(abs) |
|
652 | names.append(abs) | |
653 |
if not opts |
|
653 | if not opts.get('dry_run'): | |
654 | repo.add(names) |
|
654 | repo.add(names) | |
655 |
|
655 | |||
656 | def addremove(ui, repo, *pats, **opts): |
|
656 | def addremove(ui, repo, *pats, **opts): | |
@@ -1076,21 +1076,21 b' def docopy(ui, repo, pats, opts, wlock):' | |||||
1076 | ui.warn(_('%s: not overwriting - file exists\n') % |
|
1076 | ui.warn(_('%s: not overwriting - file exists\n') % | |
1077 | reltarget) |
|
1077 | reltarget) | |
1078 | return |
|
1078 | return | |
1079 |
if not opts['after'] and not opts |
|
1079 | if not opts['after'] and not opts.get('dry_run'): | |
1080 | os.unlink(reltarget) |
|
1080 | os.unlink(reltarget) | |
1081 | if opts['after']: |
|
1081 | if opts['after']: | |
1082 | if not os.path.exists(reltarget): |
|
1082 | if not os.path.exists(reltarget): | |
1083 | return |
|
1083 | return | |
1084 | else: |
|
1084 | else: | |
1085 | targetdir = os.path.dirname(reltarget) or '.' |
|
1085 | targetdir = os.path.dirname(reltarget) or '.' | |
1086 |
if not os.path.isdir(targetdir) and not opts |
|
1086 | if not os.path.isdir(targetdir) and not opts.get('dry_run'): | |
1087 | os.makedirs(targetdir) |
|
1087 | os.makedirs(targetdir) | |
1088 | try: |
|
1088 | try: | |
1089 | restore = repo.dirstate.state(abstarget) == 'r' |
|
1089 | restore = repo.dirstate.state(abstarget) == 'r' | |
1090 |
if restore and not opts |
|
1090 | if restore and not opts.get('dry_run'): | |
1091 | repo.undelete([abstarget], wlock) |
|
1091 | repo.undelete([abstarget], wlock) | |
1092 | try: |
|
1092 | try: | |
1093 |
if not opts |
|
1093 | if not opts.get('dry_run'): | |
1094 | shutil.copyfile(relsrc, reltarget) |
|
1094 | shutil.copyfile(relsrc, reltarget) | |
1095 | shutil.copymode(relsrc, reltarget) |
|
1095 | shutil.copymode(relsrc, reltarget) | |
1096 | restore = False |
|
1096 | restore = False | |
@@ -1110,7 +1110,7 b' def docopy(ui, repo, pats, opts, wlock):' | |||||
1110 | if ui.verbose or not exact: |
|
1110 | if ui.verbose or not exact: | |
1111 | ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) |
|
1111 | ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) | |
1112 | targets[abstarget] = abssrc |
|
1112 | targets[abstarget] = abssrc | |
1113 |
if abstarget != origsrc and not opts |
|
1113 | if abstarget != origsrc and not opts.get('dry_run'): | |
1114 | repo.copy(origsrc, abstarget, wlock) |
|
1114 | repo.copy(origsrc, abstarget, wlock) | |
1115 | copied.append((abssrc, relsrc, exact)) |
|
1115 | copied.append((abssrc, relsrc, exact)) | |
1116 |
|
1116 | |||
@@ -2334,7 +2334,7 b' def rename(ui, repo, *pats, **opts):' | |||||
2334 | if ui.verbose or not exact: |
|
2334 | if ui.verbose or not exact: | |
2335 | ui.status(_('removing %s\n') % rel) |
|
2335 | ui.status(_('removing %s\n') % rel) | |
2336 | names.append(abs) |
|
2336 | names.append(abs) | |
2337 |
if not opts |
|
2337 | if not opts.get('dry_run'): | |
2338 | repo.remove(names, True, wlock) |
|
2338 | repo.remove(names, True, wlock) | |
2339 | return errs |
|
2339 | return errs | |
2340 |
|
2340 |
General Comments 0
You need to be logged in to leave comments.
Login now