# HG changeset patch # User Pierre-Yves David # Date 2012-09-20 22:33:30 # Node ID 64e0f0cfb569da2c7221f36da6816ecb667dc1f8 # Parent bea381c16809eea959239b6fbae34dff8b47c5e9 histedit: move makedesc function near other rules related function Having it in the middle of action logic is confusing diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -282,20 +282,6 @@ def message(ui, repo, ctx, ha, opts): # We didn't make an edit, so just indicate no replaced nodes return newctx, [new], [], [] - -def makedesc(c): - """build a initial action line for a ctx `c` - - line are in the form: - - pick - """ - summary = '' - if c.description(): - summary = c.description().splitlines()[0] - line = 'pick %s %d %s' % (c.hex()[:12], c.rev(), summary) - return line[:80] # trim to 80 chars so it's not stupidly wide in my editor - actiontable = {'p': pick, 'pick': pick, 'e': edit, @@ -641,6 +627,19 @@ def readstate(repo): return pickle.load(fp) +def makedesc(c): + """build a initial action line for a ctx `c` + + line are in the form: + + pick + """ + summary = '' + if c.description(): + summary = c.description().splitlines()[0] + line = 'pick %s %d %s' % (c.hex()[:12], c.rev(), summary) + return line[:80] # trim to 80 chars so it's not stupidly wide in my editor + def verifyrules(rules, repo, ctxs): """Verify that there exists exactly one edit rule per given changeset.