comparison hgext/absorb.py @ 40951:e993a86cfcb8

absorb: don't prompt to apply changes when there are none to apply Differential Revision: https://phab.mercurial-scm.org/D5428
author Danny Hooper <hooper@google.com>
date Thu, 13 Dec 2018 20:39:25 -0800
parents fa88170c10bb
children c146651a78e1
comparison
equal deleted inserted replaced
40950:52fbf8a9907c 40951:e993a86cfcb8
969 descfirstline = ctx.description().splitlines()[0] 969 descfirstline = ctx.description().splitlines()[0]
970 fm.write('descfirstline', '%s\n', descfirstline, 970 fm.write('descfirstline', '%s\n', descfirstline,
971 label='absorb.description') 971 label='absorb.description')
972 fm.end() 972 fm.end()
973 if not opts.get('dry_run'): 973 if not opts.get('dry_run'):
974 if not opts.get('apply_changes'): 974 if (not opts.get('apply_changes') and
975 if ui.promptchoice("apply changes (yn)? $$ &Yes $$ &No", default=1): 975 state.ctxaffected and
976 raise error.Abort(_('absorb cancelled\n')) 976 ui.promptchoice("apply changes (yn)? $$ &Yes $$ &No", default=1)):
977 raise error.Abort(_('absorb cancelled\n'))
977 978
978 state.apply() 979 state.apply()
979 if state.commit(): 980 if state.commit():
980 state.printchunkstats() 981 state.printchunkstats()
981 elif not ui.quiet: 982 elif not ui.quiet: