changeset 24271:18792f2e38bb

record: remove dependency on hg module in record Part of a series of patches to move record from hgext to core
author Laurent Charignon <lcharignon@fb.com>
date Tue, 10 Mar 2015 17:09:07 -0700
parents c256ae48fd26
children 26a1c617e047
files hgext/record.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: