# HG changeset patch # User Matt Mackall # Date 1196642482 21600 # Node ID 4b7b21acede037fdfac21ea372888ecc68f754e1 # Parent 9981b6b19ecf947e43710aad60010cf94fba9f05 copy: fix copying back with -A (issue836) diff -r 9981b6b19ecf -r 4b7b21acede0 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Dec 02 18:11:59 2007 -0600 +++ b/mercurial/cmdutil.py Sun Dec 02 18:41:22 2007 -0600 @@ -366,7 +366,11 @@ if ui.verbose or not exact: ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) targets[abstarget] = abssrc - if abstarget != origsrc: + if abstarget == origsrc: # copying back a copy? + if repo.dirstate[abstarget] not in 'mn': + if not opts.get('dry_run'): + repo.add([abstarget]) + else: if repo.dirstate[origsrc] == 'a': if not ui.quiet: ui.warn(_("%s has not been committed yet, so no copy "