mercurial/cmdutil.py
changeset 11303 a1aad8333864
parent 11290 8c6c7f6347a3
child 11405 bf5d88c466e0
--- 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