comparison hgext/histedit.py @ 29469:ffa194c3a83c

histedit: use _getsummary in ruleeditor This patch uses our common method instead of duplicating logic.
author Sean Farley <sean@farley.io>
date Fri, 27 May 2016 14:03:00 -0700
parents 04b68ce5e964
children 2ff243c415b4
comparison
equal deleted inserted replaced
29468:04b68ce5e964 29469:ffa194c3a83c
1316 rules are in the format [ [act, ctx], ...] like in state.rules 1316 rules are in the format [ [act, ctx], ...] like in state.rules
1317 """ 1317 """
1318 if repo.ui.configbool("experimental", "histedit.autoverb"): 1318 if repo.ui.configbool("experimental", "histedit.autoverb"):
1319 for act in actions: 1319 for act in actions:
1320 ctx = repo[act.node] 1320 ctx = repo[act.node]
1321 summary = '' 1321 summary = _getsummary(ctx)
1322 if ctx.description():
1323 summary = ctx.description().splitlines()[0]
1324
1325 fword = summary.split(' ', 1)[0].lower() 1322 fword = summary.split(' ', 1)[0].lower()
1326 # if it doesn't end with the special character '!' just skip this 1323 # if it doesn't end with the special character '!' just skip this
1327 if fword.endswith('!'): 1324 if fword.endswith('!'):
1328 fword = fword[:-1] 1325 fword = fword[:-1]
1329 if fword in primaryactions | secondaryactions | tertiaryactions: 1326 if fword in primaryactions | secondaryactions | tertiaryactions: