review: rename "upload" command to "mail"
TODO is done
Change-Id: Ia0c71cf786426135cff4f88feded178ac48de3a5
Reviewed-on: https://go-review.googlesource.com/1122
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/upload.go b/mail.go
similarity index 81%
rename from upload.go
rename to mail.go
index c5810fa..5cb6742 100644
--- a/upload.go
+++ b/mail.go
@@ -11,15 +11,15 @@
"strings"
)
-func upload(args []string) {
+func mail(args []string) {
var (
- diff = flags.Bool("diff", false, "show change commit diff and don't upload")
- force = flags.Bool("f", false, "upload even if there are staged changes")
+ diff = flags.Bool("diff", false, "show change commit diff and don't upload or mail")
+ force = flags.Bool("f", false, "mail even if there are staged changes")
rList = flags.String("r", "", "comma-separated list of reviewers")
ccList = flags.String("cc", "", "comma-separated list of people to CC:")
)
flags.Usage = func() {
- fmt.Fprintf(os.Stderr, "Usage: %s upload %s [-r reviewer,...] [-cc mail,...]\n", os.Args[0], globalFlags)
+ fmt.Fprintf(os.Stderr, "Usage: %s mail %s [-r reviewer,...] [-cc mail,...]\n", os.Args[0], globalFlags)
}
flags.Parse(args)
if len(flags.Args()) != 0 {
@@ -29,10 +29,10 @@
branch := CurrentBranch()
if branch.Name == "master" {
- dief("on master branch; can't upload.")
+ dief("on master branch; can't mail.")
}
if branch.ChangeID == "" {
- dief("no pending change; can't upload.")
+ dief("no pending change; can't mail.")
}
if *diff {
@@ -42,7 +42,7 @@
if !*force && hasStagedChanges() {
dief("there are staged changes; aborting.\n" +
- "Use 'review change' to include them or 'review upload -f' to force upload.")
+ "Use 'review change' to include them or 'review mail -f' to force it.")
}
refSpec := "HEAD:refs/for/master"
diff --git a/review.go b/review.go
index 96a6f6d..c5ca2f8 100644
--- a/review.go
+++ b/review.go
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// TODO(adg): rename 'upload' to 'mail'
// TODO(adg): recognize non-master remote branches
// TODO(adg): accept -a flag on 'commit' (like git commit -a)
// TODO(adg): check style of commit message
@@ -60,12 +59,13 @@
Show local branches and their head commits.
If -r is specified, show additional information from Gerrit.
- upload [-f] [-r reviewer,...] [-cc mail,...]
- Upload change commit to the code review server.
+ mail [-f] [-r reviewer,...] [-cc mail,...]
+ Upload change commit to the code review server and send mail
+ requesting a code review.
If -f is specified, upload even if there are staged changes.
- upload -diff
- Show the changes but do not upload.
+ mail -diff
+ Show the changes but do not send mail or upload.
sync
Fetch changes from the remote repository and merge them into
@@ -96,8 +96,8 @@
change(args)
case "pending", "p":
pending(args)
- case "upload", "up", "u":
- upload(args)
+ case "mail", "m":
+ mail(args)
case "sync", "s":
doSync(args)
case "revert":