diff options
author | Russ Cox <rsc@golang.org> | 2010-07-26 17:33:50 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-07-26 17:33:50 -0700 |
commit | bbf925aa56bd9b7dbd07ced8506cbdf725e146a6 (patch) | |
tree | afc021e3100ad5b4998ba8ef9776baa2a8035c1a | |
parent | b49561d884237703732a34a047cf7fe1f1373946 (diff) | |
download | go-bbf925aa56bd9b7dbd07ced8506cbdf725e146a6.tar.gz go-bbf925aa56bd9b7dbd07ced8506cbdf725e146a6.zip |
codereview: avoid crash if no config
Fixes #959.
R=r
CC=golang-dev
https://golang.org/cl/1876045
-rw-r--r-- | lib/codereview/codereview.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index baed951225..84fbee61fa 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -1632,7 +1632,11 @@ def RietveldSetup(ui, repo): if line.startswith('defaultcc: '): defaultcc = SplitCommaSpace(line[10:]) except: - pass + # If there are no options, chances are good this is not + # a code review repository; stop now before we foul + # things up even worse. Might also be that repo doesn't + # even have a root. See issue 959. + return try: f = open(repo.root + '/CONTRIBUTORS', 'r') |