-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from avancinirodrigo/develop
Adding repository snapshot feature
- Loading branch information
Showing
15 changed files
with
388 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
component_depth: 1 | ||
languages: | ||
- python | ||
exclude: | ||
- /poc/.* | ||
- /scripts/.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ecolyzer/repository/git.py → ecolyzer/repository/gitpython.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from git import Repo | ||
|
||
def show_tree_files(tree, spaces_count): | ||
spaces = '' | ||
spaces += ' ' * spaces_count | ||
for blob in tree.blobs: | ||
#print(blob.name) | ||
if blob.path == 'packages/base/lua/Cell.lua': | ||
print(spaces + '++', blob.name, blob.path, type(blob)) | ||
data = blob.data_stream.read() | ||
print(data.decode('ascii')) | ||
|
||
def show_tree_dirs(trees, spaces_count): | ||
spaces = '' | ||
spaces += ' ' * spaces_count | ||
if len(trees) > 0: | ||
for tree in trees: | ||
#print(spaces + '--', tree.name) | ||
show_tree_files(tree, spaces_count + 2) | ||
show_tree_dirs(tree.trees, spaces_count + 2) | ||
|
||
path = 'repo/terrame' | ||
repo = Repo(path) | ||
git_dir = repo.git_dir | ||
|
||
print(git_dir) | ||
|
||
tree = repo.tree() | ||
print(type(tree)) | ||
#for t in tree.trees: | ||
# print(t.name, type(t)) | ||
#show_tree_dirs(t.trees, 2) | ||
#show_tree_files(t, 2) | ||
#print(t.__dict__) | ||
#print(' --', t.trees[0].name) | ||
#for b in t.blobs: | ||
# print(' --', b.name, b.path) | ||
|
||
for obj in tree: | ||
print(obj, type(obj.path), list(repo.iter_commits(paths=obj.path, max_count=1))[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.