Skip to content
Snippets Groups Projects
Commit 4c4232e51167 authored by Sean Farley's avatar Sean Farley
Browse files

histedit: extract common summary code into method

We're going to need to use this code in our autoverb logic so let's
extract it now and save ourselves from code duplication.
parent a0efbfbba7b5
No related branches found
No related tags found
No related merge requests found
......@@ -1269,6 +1269,14 @@
'histedit')
state.backupfile = backupfile
def _getsummary(ctx):
# a common pattern is to extract the summary but default to the empty
# string
summary = ctx.description() or ''
if summary:
summary = summary.splitlines()[0]
return summary
def bootstrapcontinue(ui, state, opts):
repo = state.repo
if state.actions:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment