gophertool: also accept commit form 8486:ab29d2698a47

... as "hg log" produces by default.

And add a README.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4529080
This commit is contained in:
Brad Fitzpatrick 2011-05-23 14:27:51 -07:00
parent 32d127823f
commit f5a011dd0c
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,8 @@
To install:
1) chrome://extensions/
2) click "[+] Developer Mode" in top right
3) "Load unpacked extension..."
4) pick $GOROOT/misc/chrome/gophertool
Done. It'll now auto-reload from source.

View File

@ -13,7 +13,7 @@ function focusinput() {
}
var numericRE = /^\d+$/;
var commitRE = /^[0-9a-f]{6,20}$/;
var commitRE = /^(?:\d+:)?([0-9a-f]{6,20})$/; // e.g "8486:ab29d2698a47" or "ab29d2698a47"
var pkgRE = /^[a-z0-9_\/]+$/;
function navigate() {
@ -38,8 +38,9 @@ function navigate() {
return success("http://codereview.appspot.com/" + t + "/");
}
if (commitRE.test(t)) {
return success("http://code.google.com/p/go/source/detail?r=" + t);
var match = commitRE.exec(t);
if (match) {
return success("http://code.google.com/p/go/source/detail?r=" + match[1])
}
if (pkgRE.test(t)) {