Rev 69: Rename the extension to _pyx, since Robert prefers that form in http://bzr.arbash-meinel.com/plugins/groupcompress_rabin
John Arbash Meinel
john at arbash-meinel.com
Mon Mar 2 17:05:37 GMT 2009
At http://bzr.arbash-meinel.com/plugins/groupcompress_rabin
------------------------------------------------------------
revno: 69
revision-id: john at arbash-meinel.com-20090302170533-v13igzvtt0hf7y2z
parent: john at arbash-meinel.com-20090228050444-38soix727ge8yhvn
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: groupcompress_rabin
timestamp: Mon 2009-03-02 11:05:33 -0600
message:
Rename the extension to _pyx, since Robert prefers that form
-------------- next part --------------
=== modified file '.bzrignore'
--- a/.bzrignore 2009-02-27 17:36:23 +0000
+++ b/.bzrignore 2009-03-02 17:05:33 +0000
@@ -1,3 +1,3 @@
-./_groupcompress_c.c
+./_groupcompress_pyx.c
./build
./tags
=== renamed file '_groupcompress_c.pyx' => '_groupcompress_pyx.pyx'
=== modified file 'groupcompress.py'
--- a/groupcompress.py 2009-02-28 05:04:44 +0000
+++ b/groupcompress.py 2009-03-02 17:05:33 +0000
@@ -180,15 +180,9 @@
# (the idea being we just computed the delta_index, so we
# re-use it here, and see if that is good enough, etc)
# PROF: 15s to building the delta index
- delta_index = _groupcompress_c.make_delta_index(source_text)
+ delta_index = _groupcompress_pyx.make_delta_index(source_text)
# PROF: only 0.67s to actually create a delta
delta = delta_index.make_delta(target_text)
- # if delta is None and delta_index is self._last_delta_index:
- # # So this didn't compress very well, shall we try again with a
- # # better delta_index?
- # source_text = ''.join(self.lines)
- # delta_index = _groupcompress_c.make_delta_index(source_text)
- # delta = delta_index.make_delta(target_text)
if (delta is None
or len(delta) > len(target_text) / 2):
# We can't delta (perhaps source_text is empty)
@@ -232,7 +226,7 @@
bytes = delta
else:
source = ''.join(self.lines[delta_details[0][0]])
- bytes = _groupcompress_c.apply_delta(source, delta)
+ bytes = _groupcompress_pyx.apply_delta(source, delta)
if _NO_LABELS:
sha1 = sha_string(bytes)
else:
@@ -537,7 +531,7 @@
else:
# TODO: relax apply_delta so that it can allow source to be
# longer than expected
- bytes = _groupcompress_c.apply_delta(plain, delta)
+ bytes = _groupcompress_pyx.apply_delta(plain, delta)
if bytes is None:
import pdb; pdb.set_trace()
chunks = [bytes]
@@ -921,6 +915,6 @@
try:
- from bzrlib.plugins.groupcompress_rabin import _groupcompress_c
+ from bzrlib.plugins.groupcompress_rabin import _groupcompress_pyx
except ImportError:
pass
=== modified file 'setup.py'
--- a/setup.py 2009-02-27 20:40:02 +0000
+++ b/setup.py 2009-03-02 17:05:33 +0000
@@ -77,7 +77,7 @@
ext_modules.append(Extension(module_name, source,
extra_compile_args = ['-O3']))
-add_pyrex_extension('_groupcompress_c',
+add_pyrex_extension('_groupcompress_pyx',
extra_source=['diff-delta.c', 'patch-delta.c'])
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2009-02-27 17:36:23 +0000
+++ b/tests/__init__.py 2009-03-02 17:05:33 +0000
@@ -24,7 +24,7 @@
'errors',
'equivalence_table',
'groupcompress',
- '_groupcompress_c',
+ '_groupcompress_pyx',
]
standard_tests.addTests(loader.loadTestsFromModuleNames(
['bzrlib.plugins.groupcompress_rabin.tests.test_' + name for
=== renamed file 'tests/test__groupcompress_c.py' => 'tests/test__groupcompress_pyx.py'
--- a/tests/test__groupcompress_c.py 2009-02-28 04:24:48 +0000
+++ b/tests/test__groupcompress_pyx.py 2009-03-02 17:05:33 +0000
@@ -25,14 +25,14 @@
def _probe(self):
try:
- import bzrlib.plugins.groupcompress_rabin._groupcompress_c
+ import bzrlib.plugins.groupcompress_rabin._groupcompress_pyx
except ImportError:
return False
else:
return True
def feature_name(self):
- return 'bzrlib.plugins.groupcompress_rabin._groupcompress_c'
+ return 'bzrlib.plugins.groupcompress_rabin._groupcompress_pyx'
CompiledGroupCompress = _CompiledGroupCompress()
@@ -67,8 +67,8 @@
def setUp(self):
super(Test_GroupCompress, self).setUp()
self.requireFeature(CompiledGroupCompress)
- from bzrlib.plugins.groupcompress_rabin import _groupcompress_c
- self._gc_module = _groupcompress_c
+ from bzrlib.plugins.groupcompress_rabin import _groupcompress_pyx
+ self._gc_module = _groupcompress_pyx
class TestMakeAndApplyDelta(Test_GroupCompress):
More information about the bazaar-commits
mailing list