summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-12-11 13:36:55 -0500
committerRuss Cox <rsc@golang.org>2012-12-11 13:36:55 -0500
commite8e2469fc0d3a033841c572c48969cf8e40d75d6 (patch)
treea5cd76493ae49e937bb2125966fd82e4daca8151 /lib
parenta698f6eb01d67ab760c05786e0fbd83a07741ed0 (diff)
downloadgo-e8e2469fc0d3a033841c572c48969cf8e40d75d6.tar.gz
lib/codereview: suggest argument to hg mail / hg submit
R=golang-dev, iant CC=golang-dev https://codereview.appspot.com/6924050
Diffstat (limited to 'lib')
-rw-r--r--lib/codereview/codereview.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index c02f241d5..3d7b9ad5b 100644
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -807,7 +807,7 @@ def EditCL(ui, repo, cl):
# For use by submit, etc. (NOT by change)
# Get change list number or list of files from command line.
# If files are given, make a new change list.
-def CommandLineCL(ui, repo, pats, opts, defaultcc=None):
+def CommandLineCL(ui, repo, pats, opts, op="verb", defaultcc=None):
if len(pats) > 0 and GoodCLName(pats[0]):
if len(pats) != 1:
return None, "cannot specify change number and file names"
@@ -821,7 +821,7 @@ def CommandLineCL(ui, repo, pats, opts, defaultcc=None):
cl.local = True
cl.files = ChangedFiles(ui, repo, pats, taken=Taken(ui, repo))
if not cl.files:
- return None, "no files changed"
+ return None, "no files changed (use hg %s <number> to use existing CL)" % op
if opts.get('reviewer'):
cl.reviewer = Add(cl.reviewer, SplitCommaSpace(opts.get('reviewer')))
if opts.get('cc'):
@@ -1792,7 +1792,7 @@ def mail(ui, repo, *pats, **opts):
if codereview_disabled:
raise hg_util.Abort(codereview_disabled)
- cl, err = CommandLineCL(ui, repo, pats, opts, defaultcc=defaultcc)
+ cl, err = CommandLineCL(ui, repo, pats, opts, op="mail", defaultcc=defaultcc)
if err != "":
raise hg_util.Abort(err)
cl.Upload(ui, repo, gofmt_just_warn=True)
@@ -1881,7 +1881,7 @@ def submit(ui, repo, *pats, **opts):
if not opts["no_incoming"] and hg_incoming(ui, repo):
need_sync()
- cl, err = CommandLineCL(ui, repo, pats, opts, defaultcc=defaultcc)
+ cl, err = CommandLineCL(ui, repo, pats, opts, op="submit", defaultcc=defaultcc)
if err != "":
raise hg_util.Abort(err)