Files
git-hooks/hooks/git.py
Joel Brobecker ff8d81cb4a compute each commit's revlog once and then cache it
This is preparatory work for being to pass a certain amount of data
to user-defined hooks. The intent of this change is to limit the number
of times we compute that information to at most once.

Generally speaking, the main part of this change consists in adding
the following new methods to class CommitInfo:
  - raw_revlog;
  - raw_revlog_lines; and

The rest of this change is mostly adjustments to the code that needs
to access commits' rev logs to get them from a shared CommitInfo object
rather than from a play revision (SHA1).

Additionally, the function is_revert_commit in git.py, which took
a commit revision as a paramenter and needed a call to "git log"
to get the commit's body, has been replaced by a new method in
class CommitInfo. An alternative approach might have been to
keep the function, and change its parameter to be a CommitInfo object.
But it seemed more natural to make this a method of the CommitInfo
class instead, so this is what this change does.

Change-Id: Ia4bf23f24226d1e9eddafc61afd37db37f0f5287
TN: T209-005
2020-07-12 17:24:39 -07:00

18 KiB