vcstools/vcstools — pull request #23 by jbohren (2012-10-28 18:02:09+00:00)
Title: Adding get_log() function and tests to all vcs classes

I've added a function to git, svn, hg, and bzr to retrieve the VCS logs.

It can give the log for a given path and the user can optionally limit the number of entries returned. It returns the information as an array of dicts with the fields as described below in the function prototype.

I've also added some tests for each VCS, though there could arguably be more coverage.

This includes suggestions that Thibault made on the first pull request.

```python
def get_log(self, relpath=None, limit=None):
"""
Calls scm log command.

This returns a list of dictionaries with the following fields:
- id: the commit SHA or revision number
- date: the date the commit was made (python datetime)
- author: the name of the author of the commit, if available
- email: the e-mail address of the author of the commit, if available
- message: the commit message, if any

:param relpath: (optional) Log target relative to the repository root
path. If None (default), this is the root of the repository.
:param limit: (optional) the maximum number of log entries that should
be retrieved. If None (default), there is no limit.
"""
raise NotImplementedError("Base class get_log method must be overridden")
```