[PATCH 2 of 2 default] histedit: edit with custom filename

Mykola Nikishov mn at mn.com.ua
Tue Dec 1 06:15:59 UTC 2015


# HG changeset patch
# User Mykola Nikishov <mn at mn.com.ua>
# Date 1448120426 -7200
#      Sat Nov 21 17:40:26 2015 +0200
# Node ID 3d8c7e86aebbfeffa4110db777254d5c0505fd56
# Parent  66cd5f930a40b3ea2a53e75600e9ffc18f093ce4
histedit: edit with custom filename

For instance, Emacs allows to open file with special features enabled
(AKA mode) based on the path/name of the file [1]. For such cases, use
'hg-histedit-XXX.txt' as filename pattern.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html

diff -r 66cd5f930a40 -r 3d8c7e86aebb hgext/histedit.py
--- a/hgext/histedit.py	Sat Nov 21 22:04:09 2015 +0200
+++ b/hgext/histedit.py	Sat Nov 21 17:40:26 2015 +0200
@@ -1076,7 +1076,7 @@
     rules = '\n'.join([makedesc(repo, act, rev) for [act, rev] in rules])
     rules += '\n\n'
     rules += editcomment
-    rules = ui.edit(rules, ui.username())
+    rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'})
 
     # Save edit rules in .hg/histedit-last-edit.txt in case
     # the user needs to ask for help after something




More information about the Mercurial-devel mailing list