Add --merge-base-ref option to lastchange.py
This option allows the chromecast platform team to remove some custom logic in favor of a general flag that anyone can use. The --merge-base-ref flag takes a ref, such as "origin/chromium/src" and limits lastchange's calculations to the merge base between HEAD and that ref As part of this commit I simplified the VersionInfo class because it didn't need the aditional complexity of not being named-tuple. After a review of the various uses of RunGitCommand it seemed prudent to fold in the returncode and error checking into the RunGitCommand function to simplify the rest of the code. This commit also moves towards a model of failing early and providing messaging to the user about why the command failed. This led to factoring out the FetchVersionInfo function which no longer does useful work and to calculating the git top directory early in the process and using it throughout. Bug: 917159 Test: None Change-Id: If58a956f51ccc019c7be860227a0039cdc0709b8 Reviewed-on: https://chromium-review.googlesource.com/c/1387690Reviewed-by:Dirk Pranke <dpranke@chromium.org> Reviewed-by:
Andrii Shyshkalov <tandrii@chromium.org> Commit-Queue: Eli Ribble <eliribble@chromium.org> Cr-Commit-Position: refs/heads/master@{#620447}
Showing
Please register or sign in to comment