comparison hgext/record.py @ 25223:29be0450b667

record: make hg record always use the non curses interface Before this patch, hg record was running hg commit -i, therefore with the experimental.crecord=True flag, hg record was actually launching the curses record interface. Some of our users could be confused by that. This patch makes the hg record command set this flag to False, ensuring that hg record never shows the curses interface. commit -i, shelve -i and revert -i remain unchanged and use the curses interface if the experimental.crecord flag is set.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 13 May 2015 20:30:12 -0700
parents 80c5b2666a96
children 4eb8d8a44bf1
comparison
equal deleted inserted replaced
25222:0de132d5328a 25223:29be0450b667
52 ? - display help 52 ? - display help
53 53
54 This command is not available when committing a merge.''' 54 This command is not available when committing a merge.'''
55 55
56 opts["interactive"] = True 56 opts["interactive"] = True
57 commands.commit(ui, repo, *pats, **opts) 57 backup = ui.backupconfig('experimental', 'crecord')
58 try:
59 ui.setconfig('experimental', 'crecord', False, 'record')
60 commands.commit(ui, repo, *pats, **opts)
61 finally:
62 ui.restoreconfig(backup)
58 63
59 def qrefresh(origfn, ui, repo, *pats, **opts): 64 def qrefresh(origfn, ui, repo, *pats, **opts):
60 if not opts['interactive']: 65 if not opts['interactive']:
61 return origfn(ui, repo, *pats, **opts) 66 return origfn(ui, repo, *pats, **opts)
62 67
94 99
95 def committomq(ui, repo, *pats, **opts): 100 def committomq(ui, repo, *pats, **opts):
96 opts['checkname'] = False 101 opts['checkname'] = False
97 mq.new(ui, repo, patch, *pats, **opts) 102 mq.new(ui, repo, patch, *pats, **opts)
98 103
99 cmdutil.dorecord(ui, repo, committomq, 'qnew', False, 104 backup = ui.backupconfig('experimental', 'crecord')
100 cmdutil.recordfilter, *pats, **opts) 105 try:
106 ui.setconfig('experimental', 'crecord', False, 'record')
107 cmdutil.dorecord(ui, repo, committomq, 'qnew', False,
108 cmdutil.recordfilter, *pats, **opts)
109 finally:
110 ui.restoreconfig(backup)
101 111
102 def qnew(origfn, ui, repo, patch, *args, **opts): 112 def qnew(origfn, ui, repo, patch, *args, **opts):
103 if opts['interactive']: 113 if opts['interactive']:
104 return qrecord(ui, repo, patch, *args, **opts) 114 return qrecord(ui, repo, patch, *args, **opts)
105 return origfn(ui, repo, patch, *args, **opts) 115 return origfn(ui, repo, patch, *args, **opts)