Permalink
Browse files

Add "open" subcommand to git-review to open the page in $BROWSER

  • Loading branch information...
1 parent 374a37d commit 0ce73b041932aff5285a9c05039da55c40687c5e @indirect indirect committed Oct 2, 2009
Showing with 21 additions and 0 deletions.
  1. +21 −0 bin/git-review
View
@@ -356,6 +356,23 @@ updateReview() {
startReview $change
}
+openReview() {
+ if ! get_change_number_from_branch; then
+ warn "$CURRENT is not a review branch"
+ exit 2
+ fi
+
+ if [[ -z "$BROWSER" ]]; then
+ warn "BROWSER is not set. Sorry."
+ exit 2
+ fi
+
+ if [[ ! -z "$BROWSER" ]]; then
+ eval "$BROWSER http://review.core/$CHANGE"
+ exit 0
+ fi
+}
+
abort_on_bad_repo_state() {
if ! no_changes; then
die "You have local changes. Please do something with them before using $this"
@@ -416,6 +433,10 @@ while true; do
updateReview
exit
;;
+ open)
+ openReview
+ exit
+ ;;
*)
if is_integer $arg; then
startReview $arg

0 comments on commit 0ce73b0

Please sign in to comment.