changeset 54:0a2eebee219c

Change import style to allow demandimport to do its thing. This has two beneficial side-effects: - reduce overhead of enabling crecord - push the setlocale() call back so it only happens when crecord is actually used, reducing the possibility of a bad LANG setting causing Mercurial to print 'failed to import crecord' message
author Greg Ward <greg@gerg.ca>
date Mon, 31 Aug 2009 15:02:19 -0400
parents fc29a1d8901f
children 03f6f5a3ffad
files crecord/crecord_core.py
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/crecord/crecord_core.py
+++ b/crecord/crecord_core.py
@@ -13,8 +13,8 @@
 from mercurial import util
 import cStringIO, errno, os, re, tempfile
 
-from crpatch import parsepatch, filterpatch
-from chunk_selector import chunkselector
+import crpatch
+import chunk_selector
 
 def dorecord(ui, repo, committer, *pats, **opts):
     if not ui.interactive:
@@ -48,11 +48,15 @@
 
         # 1. filter patch, so we have intending-to apply subset of it
         if changes is not None:
-            chunks = filterpatch(opts, parsepatch(changes, fp), chunkselector)
+            chunks = crpatch.filterpatch(opts,
+                                         crpatch.parsepatch(changes, fp),
+                                         chunk_selector.chunkselector)
         else:
             chgs = repo.status(match=match)[:3]
-            chunks = filterpatch(opts, parsepatch(chgs, fp), chunkselector)
-            
+            chunks = crpatch.filterpatch(opts,
+                                         crpatch.parsepatch(chgs, fp),
+                                         chunk_selector.chunkselector)
+
         del fp
 
         contenders = {}