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

Sean Farley sean at farley.io
Thu Jun 30 17:58:54 EDT 2016


# HG changeset patch
# User Sean Farley <sean at 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.

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:


More information about the Mercurial-devel mailing list