]> Cypherpunks repositories - gostls13.git/commitdiff
gophertool: also accept commit form 8486:ab29d2698a47
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 23 May 2011 21:27:51 +0000 (14:27 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 23 May 2011 21:27:51 +0000 (14:27 -0700)
... as "hg log" produces by default.

And add a README.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4529080

misc/chrome/gophertool/README.txt [new file with mode: 0644]
misc/chrome/gophertool/popup.html

diff --git a/misc/chrome/gophertool/README.txt b/misc/chrome/gophertool/README.txt
new file mode 100644 (file)
index 0000000..a7c0b4b
--- /dev/null
@@ -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.
index a953054c781842565ddcbe9164619bf9c29ab7b3..4e30ced86cda9cc736cf9eaea782ed1f78e26183 100644 (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)) {