changeset 14407:51cabd567ac6

record: suggest the right command when running non interactively
author Idan Kamara <idankk86@gmail.com>
date Sun, 22 May 2011 16:10:02 +0300
parents c97c10a1b4bc
children 054da1e0afbe
files hgext/record.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/record.py	Sun May 22 11:03:15 2011 +0200
+++ b/hgext/record.py	Sun May 22 16:10:02 2011 +0300
@@ -368,7 +368,7 @@
 
     This command is not available when committing a merge.'''
 
-    dorecord(ui, repo, commands.commit, *pats, **opts)
+    dorecord(ui, repo, commands.commit, 'commit', *pats, **opts)
 
 
 def qrecord(ui, repo, patch, *pats, **opts):
@@ -386,12 +386,13 @@
     def committomq(ui, repo, *pats, **opts):
         mq.new(ui, repo, patch, *pats, **opts)
 
-    dorecord(ui, repo, committomq, *pats, **opts)
+    dorecord(ui, repo, committomq, 'qnew', *pats, **opts)
 
 
-def dorecord(ui, repo, commitfunc, *pats, **opts):
+def dorecord(ui, repo, commitfunc, cmdsuggest, *pats, **opts):
     if not ui.interactive():
-        raise util.Abort(_('running non-interactively, use commit instead'))
+        raise util.Abort(_('running non-interactively, use %s instead') %
+                         cmdsuggest)
 
     def recordfunc(ui, repo, message, match, opts):
         """This is generic record driver.