Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 11303:a1aad8333864
move working dir/dirstate methods from localrepo to workingctx
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 07 Jun 2010 20:03:32 +0200 |
parents | 8c6c7f6347a3 |
children | bf5d88c466e0 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Jun 03 23:18:18 2010 -0500 +++ b/mercurial/cmdutil.py Mon Jun 07 20:03:32 2010 +0200 @@ -311,12 +311,13 @@ copies[new] = old if not dry_run: + wctx = repo[None] wlock = repo.wlock() try: - repo.remove(deleted) - repo.add(unknown) + wctx.remove(deleted) + wctx.add(unknown) for new, old in copies.iteritems(): - repo.copy(old, new) + wctx.copy(old, new) finally: wlock.release() @@ -329,6 +330,7 @@ targets = {} after = opts.get("after") dryrun = opts.get("dry_run") + wctx = repo[None] def walkpat(pat): srcs = [] @@ -421,12 +423,12 @@ "data will be stored for %s.\n") % (repo.pathto(origsrc, cwd), reltarget)) if repo.dirstate[abstarget] in '?r' and not dryrun: - repo.add([abstarget]) + wctx.add([abstarget]) elif not dryrun: - repo.copy(origsrc, abstarget) + wctx.copy(origsrc, abstarget) if rename and not dryrun: - repo.remove([abssrc], not after) + wctx.remove([abssrc], not after) # pat: ossep # dest ossep