From 73bc3fc0a50e1d9b0f6717a692d5883d42127860 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 27 Feb 2010 17:40:26 +0100 Subject: [PATCH] make the blobtracker... not a blobtracker any more. --- blobtracker.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/blobtracker.py b/blobtracker.py index df99a85..5f6c789 100755 --- a/blobtracker.py +++ b/blobtracker.py @@ -12,19 +12,6 @@ from git import git class BlobTracker(object): - def scan_commit_tree(self, commit, autocommit=True): - blobs = set() - for line in git('ls-tree', '-r', commit.sha1, ret_pipe=True): - assert line.endswith('\n') - rest, name = line[:-1].split('\t', 1) - mode, type, sha1 = rest.split(' ') - blob = dbcache.blob_cache.get(sha1) - blob.update_contained_in(commit) - basename = os.path.basename(name) - fname = dbcache.file_cache.get(basename) # magically creates it - dbcache.blob_cache.flush() - dbcache.file_cache.flush() - def scan_commit(self, sha1, autocommit=True, patch_ids=None): if not patch_ids: patch_ids = {} @@ -47,19 +34,12 @@ class BlobTracker(object): else: commit = db.Commit(sha1, cdate, adate, author, patch_ids.get(sha1, None)) db.session.add(commit) - self.scan_commit_tree(commit, autocommit=autocommit) def scan_history(self, refs): refdata = git('rev-parse', *refs)[0] refs = refdata.split() boundaries = db.session.query(db.Boundary).all() args = refs + ['--not'] + [b.sha1 for b in boundaries] - patch_ids = {} - print 'log -p | patch-id ...' - pipe = git('log', '-p', '--no-merges', *args, **{'ret_pipe':True}) - for line in git('patch-id', input_pipe=pipe, ret_pipe=True): - patch_id, commit_sha1 = line.split() - patch_ids[commit_sha1] = patch_id print 'reading trees ...' count = 0 for line in git('rev-list', '--no-merges', *args, **{'ret_pipe':True}): -- 2.11.4.GIT