Patchwork [5,of,6,V2] histedit: use _getsummary in ruleeditor

login
register
mail settings
Submitter Sean Farley
Date June 30, 2016, 9:58 p.m.
Message ID <bf3cabc7104d684d550a.1467323934@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/15691/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Sean Farley - June 30, 2016, 9:58 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1464382980 25200
#      Fri May 27 14:03:00 2016 -0700
# Node ID bf3cabc7104d684d550a6c692f526b35ab8bfbc0
# Parent  2482b0725cbaa6d139979fe9197975177d7f79fd
# EXP-Topic autoverb
histedit: use _getsummary in ruleeditor

This patch uses our common method instead of duplicating logic.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1316,14 +1316,11 @@  def ruleeditor(repo, ui, actions, editco
     rules are in the format [ [act, ctx], ...] like in state.rules
     """
     if repo.ui.configbool("experimental", "histedit.autoverb"):
         for act in actions:
             ctx = repo[act.node]
-            summary = ''
-            if ctx.description():
-                summary = ctx.description().splitlines()[0]
-
+            summary = _getsummary(ctx)
             fword = summary.split(' ', 1)[0].lower()
             # if it doesn't end with the special character '!' just skip this
             if fword.endswith('!'):
                 fword = fword[:-1]
                 if fword in primaryactions | secondaryactions | tertiaryactions: