Cached builds

Source units now point to their previous revision if the unit isn't changed, and those units aren't rebuilt during the `make` step.

If this errors, srclib prints a warning and builds the repository
normally.

Quinn Slack writes:

>> +func listRevisions(vcsType string, dir string) ([]string, error) {
>> +	if vcsType != "git" {
>> +		return nil, fmt.Errorf("listRevisions: unsupported vcs type: %q", vcsType)
>> +	}
>> +	cmd := exec.Command("git", "rev-list", "--max-count=5", "HEAD")
>> +	cmd.Dir = dir
>> +	out, err := cmd.CombinedOutput()
>> +	if err != nil {
>> +		return nil, err
>> +	}
>> +	return strings.Split(string(bytes.TrimSpace(out)), "\n"), nil
>> +}
>> +
>> +func changedFilesFromCurrentRev(vcsType string, dir string, fromRev string) ([]string, error) {
>> +	if vcsType != "git" {
>> +		return nil, fmt.Errorf("changedFilesFromCurrentRev: unsupported vcs type: %q", vcsType)
>
> It's fine to not implement this (and `listRevisions`) for hg, but does this mean that all builds of hg repos will now fail? Or is the error ignored? It should revert to the old behavior for unsupported VCS types (hg).
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/sourcegraph/srclib/pull/97/files#r22396120

-- 
    Samer