This function supports four ways of specifying the range of commits to process: Method 1: rev Pass `rev` parameter and set both `from_beginning` and `from_last_processed` to False. `rev` is the revision specifier which follows
(self, rev=None,
from_beginning=False, num_commits=None,
from_last_processed=False, end_commit_sha=None,
into_branches=False,
max_branch_length=100,
min_branch_date=None,
checkpoint_interval=100,
skip_work=False,
verbose=True)
| 51 | self.last_processed_commit = None |
| 52 | |
| 53 | def process(self, rev=None, |
| 54 | from_beginning=False, num_commits=None, |
| 55 | from_last_processed=False, end_commit_sha=None, |
| 56 | into_branches=False, |
| 57 | max_branch_length=100, |
| 58 | min_branch_date=None, |
| 59 | checkpoint_interval=100, |
| 60 | skip_work=False, |
| 61 | verbose=True): |
| 62 | """ |
| 63 | This function supports four ways of specifying the |
| 64 | range of commits to process: |
| 65 | |
| 66 | Method 1: rev |
| 67 | Pass `rev` parameter and set both |
| 68 | `from_beginning` and `from_last_processed` to False. |
| 69 | `rev` is the revision specifier which follows |
| 70 | an extended SHA-1 syntax. Please refer to git-rev-parse |
| 71 | for viable options. `rev' should only include commits |
| 72 | on the master branch. |
| 73 | |
| 74 | Method 2: from_beginning & num_commits (optional) |
| 75 | Set `from_beginning` to True and |
| 76 | pass `num_commits` parameter. Using this |
| 77 | method, the function will start from the |
| 78 | very first commit on the master branch and |
| 79 | process the following `num_commits` commits |
| 80 | (also on the master branch). |
| 81 | |
| 82 | Method 3: from_last_processed & num_commits |
| 83 | Set `from_last_processed` to True and pass |
| 84 | `num_commits` parameter. Using this method, the |
| 85 | function will resume processing from succeeding commit of |
| 86 | `self.last_processed_commit` for `num_commits` commits. |
| 87 | |
| 88 | Method 4: from_last_processed & end_commit_sha |
| 89 | Set `from_last_processed` to True and pass |
| 90 | `end_commit_sha` parameter. The range of continued processing |
| 91 | will be `self.last_processed_commit.hexsha..end_commit_sha`. |
| 92 | |
| 93 | Args: |
| 94 | rev: A string, see above. |
| 95 | num_commits: An int, see above. |
| 96 | from_beginning: A boolean flag, see above. |
| 97 | from_last_processed: A boolean flag, see above. |
| 98 | end_commit_sha: A string, see above. |
| 99 | into_branches: A boolean flag, if True, the process function |
| 100 | will operate in two phases. |
| 101 | |
| 102 | In the first phase, a call commit graph is contructed |
| 103 | by traversing the specified range of commits on the master |
| 104 | branch. Merge commits are detected and recorded if the |
| 105 | start commit (on master) and end/merge commit of the |
| 106 | corresponding branch are both within the range of |
| 107 | traversal. Those recorded merge commits do not |
| 108 | get any credits (thus they are not present in |
| 109 | self.history data structure). |
| 110 |