record: remove dependency on hg module in record
authorLaurent Charignon <lcharignon@fb.com>
Tue, 10 Mar 2015 17:09:07 -0700
changeset 24271 18792f2e38bb
parent 24270 c256ae48fd26
child 24272 26a1c617e047
record: remove dependency on hg module in record Part of a series of patches to move record from hgext to core
hgext/record.py
--- a/hgext/record.py	Tue Mar 10 17:03:40 2015 -0700
+++ b/hgext/record.py	Tue Mar 10 17:09:07 2015 -0700
@@ -8,8 +8,9 @@
 '''commands to interactively select changes for commit/qrefresh'''
 
 from mercurial.i18n import _
-from mercurial import cmdutil, commands, extensions, hg, patch
+from mercurial import cmdutil, commands, extensions, patch
 from mercurial import util
+from mercurial import merge as mergemod
 import cStringIO, errno, os, shutil, tempfile
 
 cmdtable = {}
@@ -205,8 +206,10 @@
 
             # 3a. apply filtered patch to clean repo  (clean)
             if backups:
-                hg.revert(repo, repo.dirstate.p1(),
-                          lambda key: key in backups)
+                # Equivalent to hg.revert
+                choices = lambda key: key in backups
+                mergemod.update(repo, repo.dirstate.p1(),
+                        False, True, choices)
 
             # 3b. (apply)
             if dopatch: