changeset 17643:64e0f0cfb569

histedit: move makedesc function near other rules related function Having it in the middle of action logic is confusing
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 21 Sep 2012 00:33:30 +0200
parents bea381c16809
children 9ae073f10572
files hgext/histedit.py
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Fri Sep 21 19:14:04 2012 +0200
+++ b/hgext/histedit.py	Fri Sep 21 00:33:30 2012 +0200
@@ -282,20 +282,6 @@
     # 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 <hash> <rev> <summary>
-    """
-    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 @@
     return pickle.load(fp)
 
 
+def makedesc(c):
+    """build a initial action line for a ctx `c`
+
+    line are in the form:
+
+      pick <hash> <rev> <summary>
+    """
+    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.