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

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


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

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


More information about the Mercurial-devel mailing list