diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-11-15 18:14:42 +0000 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-11-25 14:25:53 +0000 |
commit | 25617bd6277e2ec44c8d6acd742280a2708a6a2c (patch) | |
tree | ac4390dfe09a7678b546061c5664522b800dc4a8 /morphlib/gitindex_tests.py | |
parent | 10a2f10450b6ff949d1387beef877f207fdbabdd (diff) | |
download | morph-25617bd6277e2ec44c8d6acd742280a2708a6a2c.tar.gz |
Cease modifying the morphologies
With `morph edit` removed, there is no need to load all the
morphologies, check whether a chunk was `morph edited`, change the
current ref to the build ref and write back the morphologies to a
temporary branch.
That is a lot of work as code profiling demonstrated. With this patch
applied, morph execution finishes around 10 seconds sooner on my
machine. This is not a big achievement when a full build is performed
where the wall clock time is dictated by the actual build commands, but
it will provide a much quicker feedback when the build artifacts were
already cached, or the semantic validation of morphologies fail.
We add the option `--untracked-files` to _get_status() in the GitIndex
class so that uncommitted morphologies on a uncommitted directory are
considered. Previously this was being done by calling the following
call in inject_build_refs():
self._root_index.add_files_from_index_info(
self._hash_morphologies(self._root, morphs.morphologies))
This commit also removes some now unused code.
Change-Id: I14215db5c06ab06045ce901131e4e341271a039d
Diffstat (limited to 'morphlib/gitindex_tests.py')
-rw-r--r-- | morphlib/gitindex_tests.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/morphlib/gitindex_tests.py b/morphlib/gitindex_tests.py index a3196764..60cbf6c8 100644 --- a/morphlib/gitindex_tests.py +++ b/morphlib/gitindex_tests.py @@ -66,16 +66,6 @@ class GitIndexTests(unittest.TestCase): idx.set_to_tree(gd.HEAD) self.assertEqual(list(idx.get_uncommitted_changes()),[]) - def test_add_files_from_index_info(self): - gd = morphlib.gitdir.GitDirectory(self.dirname) - idx = gd.get_index(os.path.join(self.tempdir, 'index')) - filepath = os.path.join(gd.dirname, 'foo') - with open(filepath, 'r') as f: - sha1 = gd.store_blob(f) - idx.add_files_from_index_info( - [(os.stat(filepath).st_mode, sha1, 'foo')]) - self.assertEqual(list(idx.get_uncommitted_changes()),[]) - def test_add_files_from_working_tree(self): gd = morphlib.gitdir.GitDirectory(self.dirname) idx = gd.get_index() |