mercurial/commands.py
changeset 1380 27add82ad845
parent 1374 c3654cfaa77d
child 1381 c29c36745c6e
equal deleted inserted replaced
1379:8ee7ce877be2 1380:27add82ad845
   766         if ui.verbose or not exact:
   766         if ui.verbose or not exact:
   767             ui.status('copying %s to %s\n' % (rel, myreldest))
   767             ui.status('copying %s to %s\n' % (rel, myreldest))
   768         if not opts['after']:
   768         if not opts['after']:
   769             try:
   769             try:
   770                 shutil.copyfile(rel, myreldest)
   770                 shutil.copyfile(rel, myreldest)
   771                 n = repo.manifest.tip()
   771                 shutil.copymode(rel, myreldest)
   772                 mf = repo.manifest.readflags(n)
       
   773                 util.set_exec(myreldest, util.is_exec(rel, mf[abs]))
       
   774             except shutil.Error, inst:
   772             except shutil.Error, inst:
   775                 raise util.Abort(str(inst))
   773                 raise util.Abort(str(inst))
   776             except IOError, inst:
   774             except IOError, inst:
   777                 if inst.errno == errno.ENOENT:
   775                 if inst.errno == errno.ENOENT:
   778                     ui.warn('%s: deleted in working copy\n' % rel)
   776                     ui.warn('%s: deleted in working copy\n' % rel)