hgext/record.py
changeset 7754 ab00d2c281a8
parent 7718 6fa7b6fb90a9
child 7910 14ec64d41dad
--- a/hgext/record.py	Thu Feb 12 12:35:48 2009 +0100
+++ b/hgext/record.py	Thu Feb 12 11:52:31 2009 +0100
@@ -406,15 +406,10 @@
         In the end we'll record intresting changes, and everything else will be
         left in place, so the user can continue his work.
         """
-        if match.files():
-            changes = None
-        else:
-            changes = repo.status(match=match)[:3]
-            modified, added, removed = changes
-            match = cmdutil.matchfiles(repo, modified + added + removed)
+
+        changes = repo.status(match=match)[:3]
         diffopts = mdiff.diffopts(git=True, nodates=True)
-        chunks = patch.diff(repo, repo.dirstate.parents()[0], match=match,
-                            changes=changes, opts=diffopts)
+        chunks = patch.diff(repo, changes=changes, opts=diffopts)
         fp = cStringIO.StringIO()
         fp.write(''.join(chunks))
         fp.seek(0)
@@ -428,15 +423,12 @@
             try: contenders.update(dict.fromkeys(h.files()))
             except AttributeError: pass
 
-        newfiles = [f for f in match.files() if f in contenders]
-
+        changed = changes[0] + changes[1] + changes[2]
+        newfiles = [f for f in changed if f in contenders]
         if not newfiles:
             ui.status(_('no changes to record\n'))
             return 0
 
-        if changes is None:
-            match = cmdutil.matchfiles(repo, newfiles)
-            changes = repo.status(match=match)
         modified = dict.fromkeys(changes[0])
 
         # 2. backup changed files, so we can restore them in the end