531 if ui.verbose or not exact: |
531 if ui.verbose or not exact: |
532 ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) |
532 ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) |
533 targets[abstarget] = abssrc |
533 targets[abstarget] = abssrc |
534 if abstarget != origsrc: |
534 if abstarget != origsrc: |
535 if repo.dirstate.state(origsrc) == 'a': |
535 if repo.dirstate.state(origsrc) == 'a': |
536 ui.warn(_("%s was marked for addition. " |
536 if not ui.quiet: |
537 "%s will not be committed as a copy.\n") |
537 ui.warn(_("%s has not been committed yet, so no copy " |
538 % (repo.pathto(origsrc, cwd), reltarget)) |
538 "data will be stored for %s.\n") |
|
539 % (repo.pathto(origsrc, cwd), reltarget)) |
539 if abstarget not in repo.dirstate and not opts.get('dry_run'): |
540 if abstarget not in repo.dirstate and not opts.get('dry_run'): |
540 repo.add([abstarget], wlock) |
541 repo.add([abstarget], wlock) |
541 elif not opts.get('dry_run'): |
542 elif not opts.get('dry_run'): |
542 repo.copy(origsrc, abstarget, wlock) |
543 repo.copy(origsrc, abstarget, wlock) |
543 copied.append((abssrc, relsrc, exact)) |
544 copied.append((abssrc, relsrc, exact)) |