]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: avoid crash if no config
authorRuss Cox <rsc@golang.org>
Tue, 27 Jul 2010 00:33:50 +0000 (17:33 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 27 Jul 2010 00:33:50 +0000 (17:33 -0700)
Fixes #959.

R=r
CC=golang-dev
https://golang.org/cl/1876045

lib/codereview/codereview.py

index baed951225d9adbe4a91514974934c88fc3b3e85..84fbee61fa666f85589c7f13a9ac66375c71dfce 100644 (file)
@@ -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')