comparison mercurial/commands.py @ 4376:de612b5f8d59

Make copy --after work for files that have been hg added.
author Brendan Cully <brendan@kublai.com>
date Tue, 24 Apr 2007 18:43:18 -0700
parents aa26759c6fb3
children e89f9afc462b f4af7960d578
comparison
equal deleted inserted replaced
4375:109077e7048d 4376:de612b5f8d59
501 ui.warn(_('%s: not overwriting - %s collides with %s\n') % 501 ui.warn(_('%s: not overwriting - %s collides with %s\n') %
502 (reltarget, util.localpath(abssrc), 502 (reltarget, util.localpath(abssrc),
503 util.localpath(prevsrc))) 503 util.localpath(prevsrc)))
504 return 504 return
505 if (not opts['after'] and os.path.exists(reltarget) or 505 if (not opts['after'] and os.path.exists(reltarget) or
506 opts['after'] and repo.dirstate.state(abstarget) not in '?r'): 506 opts['after'] and repo.dirstate.state(abstarget) not in '?ar'):
507 if not opts['force']: 507 if not opts['force']:
508 ui.warn(_('%s: not overwriting - file exists\n') % 508 ui.warn(_('%s: not overwriting - file exists\n') %
509 reltarget) 509 reltarget)
510 return 510 return
511 if not opts['after'] and not opts.get('dry_run'): 511 if not opts['after'] and not opts.get('dry_run'):