Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 5610:2493a478f395
copy: handle rename internally
- add rename parameter
- don't collect copied list
- report "moving" rather than "copying"
- remove renamed files
- don't return copied list
- simplify callers
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 07 Dec 2007 02:29:55 -0600 |
parents | 9981b6b19ecf |
children | 7e6ddde68a23 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Dec 07 02:03:42 2007 -0600 +++ b/mercurial/commands.py Fri Dec 07 02:29:55 2007 -0600 @@ -454,10 +454,9 @@ """ wlock = repo.wlock(False) try: - errs, copied = cmdutil.copy(ui, repo, pats, opts) + return cmdutil.copy(ui, repo, pats, opts) finally: del wlock - return errs def debugancestor(ui, index, rev1, rev2): """find the ancestor revision of two revisions in a given index""" @@ -2062,15 +2061,7 @@ """ wlock = repo.wlock(False) try: - errs, copied = cmdutil.copy(ui, repo, pats, opts) - names = [] - for abs, rel, exact in copied: - if ui.verbose or not exact: - ui.status(_('removing %s\n') % rel) - names.append(abs) - if not opts.get('dry_run'): - repo.remove(names, True) - return errs + return cmdutil.copy(ui, repo, pats, opts, rename=True) finally: del wlock