1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // bigEnoughAssumeRietveld is the value where CLs equal or great are
8 // assumed to be on Rietveld. By including this threshold we shrink
9 // the size of the table below. When Go amasses 150,000 more CLs, we'll
10 // need to bump this number and regenerate the list below.
11 const bigEnoughAssumeRietveld = 300000
13 // isRietveldCL reports whether cl was a Rietveld CL number.
14 func isRietveldCL(cl int) bool {
15 return cl >= bigEnoughAssumeRietveld || lowRietveldCL[cl]
18 // lowRietveldCLs are the old CL numbers assigned by Rietveld code
19 // review system as used by Go prior to Gerrit which are less than
20 // bigEnoughAssumeRietveld.
22 // This list of numbers is registered with the /cl/NNNN redirect
23 // handler to disambiguate which code review system a particular
24 // number corresponds to. In some rare cases there may be duplicates,
25 // in which case we might render an HTML choice for the user.
27 // To re-generate this list, run:
30 // $ git log 7d7c6a9..94151eb | grep "^ https://golang.org/cl/" | perl -ne 's,^\s+https://golang.org/cl/(\d+).*$,$1,; chomp; print "$_: true,\n" if $_ < 300000' | sort -n | uniq
32 // Note that we ignore the x/* repos because we didn't start using
33 // "subrepos" until the Rietveld CLs numbers were already 4,000,000+,
34 // well above bigEnoughAssumeRietveld.
35 var lowRietveldCL = map[int]bool{