diff hgext/record.py @ 25796:4eb8d8a44bf1

record: omit meaningless 'commit' suggestion at 'hg commit -i' Before this patch, 'hg commit -i' under non-interactive mode suggests 'use commit instead', and it obviously meaningless. This patch makes 'record.record'()' examine 'ui.interactive()' and show suggestion by itself before calling 'commands.commit()'. This allows 'commands.commit()' to specify 'None' for 'cmdsuggest' argument of 'cmdutil.dorecord()' to omit meaningless 'commit' suggestion at 'hg commit -i'.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 15 Jul 2015 04:45:58 +0900
parents 29be0450b667
children cc9fb45986d4
line wrap: on
line diff
--- a/hgext/record.py	Wed Jul 15 03:43:16 2015 +0900
+++ b/hgext/record.py	Wed Jul 15 04:45:58 2015 +0900
@@ -53,6 +53,10 @@
 
     This command is not available when committing a merge.'''
 
+    if not ui.interactive():
+        raise util.Abort(_('running non-interactively, use %s instead') %
+                         'commit')
+
     opts["interactive"] = True
     backup = ui.backupconfig('experimental', 'crecord')
     try: