# HG changeset patch # User Idan Kamara # Date 1306069802 -10800 # Node ID 51cabd567ac6e72d8a66301e2ed5532a1f1e06a2 # Parent c97c10a1b4bc615de043de27fc13582d36550862 record: suggest the right command when running non interactively diff -r c97c10a1b4bc -r 51cabd567ac6 hgext/record.py --- 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.