mercurial/cmdutil.py
changeset 5604 4b7b21acede0
parent 5589 9981b6b19ecf
child 5605 e7a9ad999308
equal deleted inserted replaced
5589:9981b6b19ecf 5604:4b7b21acede0
   364                     errors += 1
   364                     errors += 1
   365                     return
   365                     return
   366         if ui.verbose or not exact:
   366         if ui.verbose or not exact:
   367             ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
   367             ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
   368         targets[abstarget] = abssrc
   368         targets[abstarget] = abssrc
   369         if abstarget != origsrc:
   369         if abstarget == origsrc: # copying back a copy?
       
   370             if repo.dirstate[abstarget] not in 'mn':
       
   371                 if not opts.get('dry_run'):
       
   372                     repo.add([abstarget])
       
   373         else:
   370             if repo.dirstate[origsrc] == 'a':
   374             if repo.dirstate[origsrc] == 'a':
   371                 if not ui.quiet:
   375                 if not ui.quiet:
   372                     ui.warn(_("%s has not been committed yet, so no copy "
   376                     ui.warn(_("%s has not been committed yet, so no copy "
   373                               "data will be stored for %s.\n")
   377                               "data will be stored for %s.\n")
   374                             % (repo.pathto(origsrc, cwd), reltarget))
   378                             % (repo.pathto(origsrc, cwd), reltarget))