mercurial/commands.py
changeset 2417 3a4ae3970af3
parent 2416 04736f38d74f
child 2422 6aa75e77cafe
equal deleted inserted replaced
2416:04736f38d74f 2417:3a4ae3970af3
  1064             targetdir = os.path.dirname(reltarget) or '.'
  1064             targetdir = os.path.dirname(reltarget) or '.'
  1065             if not os.path.isdir(targetdir) and not opts['dry_run']:
  1065             if not os.path.isdir(targetdir) and not opts['dry_run']:
  1066                 os.makedirs(targetdir)
  1066                 os.makedirs(targetdir)
  1067             try:
  1067             try:
  1068                 restore = repo.dirstate.state(abstarget) == 'r'
  1068                 restore = repo.dirstate.state(abstarget) == 'r'
  1069                 if restore and not dry_run:
  1069                 if restore and not opts['dry_run']:
  1070                     repo.undelete([abstarget], wlock)
  1070                     repo.undelete([abstarget], wlock)
  1071                 try:
  1071                 try:
  1072                     if not opts['dry_run']:
  1072                     if not opts['dry_run']:
  1073                         shutil.copyfile(relsrc, reltarget)
  1073                         shutil.copyfile(relsrc, reltarget)
  1074                         shutil.copymode(relsrc, reltarget)
  1074                         shutil.copymode(relsrc, reltarget)