MCPcopy Index your code
hub / github.com/Persper/code-analytics / iter

Method iter

persper/graphs/iterator.py:14–161  ·  view source on GitHub ↗

This function supports four ways of specifying the range of commits to return: Method 1: rev Pass `rev` parameter and set both `from_beginning` and `continue_iter` to False. `rev` is the revision specifier which follows an ext

(self, rev=None,
             from_beginning=False,
             num_commits=None,
             continue_iter=False,
             end_commit_sha=None,
             into_branches=False,
             max_branch_length=100,
             min_branch_date=None)

Source from the content-addressed store, hash-verified

12 self.last_processed_commit = None
13
14 def iter(self, rev=None,
15 from_beginning=False,
16 num_commits=None,
17 continue_iter=False,
18 end_commit_sha=None,
19 into_branches=False,
20 max_branch_length=100,
21 min_branch_date=None):
22 """
23 This function supports four ways of specifying the
24 range of commits to return:
25
26 Method 1: rev
27 Pass `rev` parameter and set both
28 `from_beginning` and `continue_iter` to False.
29 `rev` is the revision specifier which follows
30 an extended SHA-1 syntax. Please refer to git-rev-parse
31 for viable options. `rev' should only include commits
32 on the master branch.
33
34 Method 2: from_beginning & num_commits (optional)
35 Set `from_beginning` to True and
36 pass `num_commits` parameter. Using this
37 method, the function will start from the
38 very first commit on the master branch and
39 process the following `num_commits` commits
40 (also on the master branch).
41
42 Method 3: continue_iter & num_commits
43 Set `continue_iter` to True and pass
44 `num_commits` parameter. Using this method, the
45 function will resume processing from succeeding commit of
46 `self.last_processed_commit` for `num_commits` commits.
47
48 Method 4: continue_iter & end_commit_sha
49 Set `continue_iter` to True and pass
50 `end_commit_sha` parameter. The range of continued processing
51 will be `self.last_processed_commit.hexsha..end_commit_sha`.
52
53 Args:
54 rev: A string, see above.
55 num_commits: An int, see above.
56 from_beginning: A boolean flag, see above.
57 continue_iter: A boolean flag, see above.
58 end_commit_sha: A string, see above.
59 into_branches: A boolean flag.
60 max_branch_length: An int, the maximum number of commits
61 to trace back before abortion.
62 min_branch_date: A python time object, stop backtracing if
63 a commit is authored before this time.
64 """
65 commits = []
66 branch_commits = []
67
68 if not continue_iter:
69 self.reset_state()
70
71 # Method 2

Callers 12

test_analyze_interfaceFunction · 0.95
test_iteratorFunction · 0.45
test_continue_iterFunction · 0.45
test_revFunction · 0.45
test_iter_twiceFunction · 0.45
test_iteratorFunction · 0.45
test_continue_iterFunction · 0.45
test_revFunction · 0.45
test_iter_twiceFunction · 0.45
analyzeMethod · 0.45
handle_func_nodeFunction · 0.45

Calls 2

reset_stateMethod · 0.95
addMethod · 0.45

Tested by 10

test_analyze_interfaceFunction · 0.76
test_iteratorFunction · 0.36
test_continue_iterFunction · 0.36
test_revFunction · 0.36
test_iter_twiceFunction · 0.36
test_iteratorFunction · 0.36
test_continue_iterFunction · 0.36
test_revFunction · 0.36
test_iter_twiceFunction · 0.36