[PATCH 3 of 4] record: remove dependency on hg module in record

Laurent Charignon lcharignon at fb.com
Tue Mar 10 21:24:30 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1426032547 25200
#      Tue Mar 10 17:09:07 2015 -0700
# Node ID 2b92363b2413d2ed90c7b8a8575e6545f5e8e0e9
# Parent  e1001632d4a719089d475692c64a47ad516de115
record: remove dependency on hg module in record

Part of a serie of patches to move record from hgext to core

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -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:


More information about the Mercurial-devel mailing list