Patchwork [4,of,6,V2] histedit: use _getsummary in torule

login
register
mail settings
Submitter Sean Farley
Date June 30, 2016, 9:58 p.m.
Message ID <2482b0725cbaa6d13997.1467323933@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/15694/
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 1464382956 25200
#      Fri May 27 14:02:36 2016 -0700
# Node ID 2482b0725cbaa6d139979fe9197975177d7f79fd
# Parent  d60ce0a4d2fb05d70f83b514474584a3e2ff3446
# EXP-Topic autoverb
histedit: use _getsummary in torule

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
@@ -418,13 +418,11 @@  class histeditaction(object):
 
         by default lines are in the form:
         <hash> <rev> <summary>
         """
         ctx = self.repo[self.node]
-        summary = ''
-        if ctx.description():
-            summary = ctx.description().splitlines()[0]
+        summary = _getsummary(ctx)
         line = '%s %s %d %s' % (self.verb, ctx, ctx.rev(), summary)
         # trim to 75 columns by default so it's not stupidly wide in my editor
         # (the 5 more are left for verb)
         maxlen = self.repo.ui.configint('histedit', 'linelen', default=80)
         maxlen = max(maxlen, 22) # avoid truncating hash