##// END OF EJS Templates
histedit: add a hint about enabled dropmissing to histedit edit comment...
Mateusz Kwapich -
r28592:cdbd9c0c default
parent child Browse files
Show More
@@ -220,13 +220,14 b' secondaryactions = set()'
220 220 tertiaryactions = set()
221 221 internalactions = set()
222 222
223 def geteditcomment(first, last):
223 def geteditcomment(ui, first, last):
224 224 """ construct the editor comment
225 225 The comment includes::
226 226 - an intro
227 227 - sorted primary commands
228 228 - sorted short commands
229 229 - sorted long commands
230 - additional hints
230 231
231 232 Commands are only included once.
232 233 """
@@ -255,8 +256,14 b' Commands:'
255 256 addverb(v)
256 257 actions.append('')
257 258
258 return ''.join(['# %s\n' % l if l else '#\n'
259 for l in ((intro % (first, last)).split('\n')) + actions])
259 hints = []
260 if ui.configbool('histedit', 'dropmissing'):
261 hints.append("Deleting a changeset from the list "
262 "will DISCARD it from the edited history!")
263
264 lines = (intro % (first, last)).split('\n') + actions + hints
265
266 return ''.join(['# %s\n' % l if l else '#\n' for l in lines])
260 267
261 268 class histeditstate(object):
262 269 def __init__(self, repo, parentctxnode=None, actions=None, keep=None,
@@ -1193,7 +1200,8 b' def _aborthistedit(ui, repo, state):'
1193 1200 def _edithisteditplan(ui, repo, state, rules):
1194 1201 state.read()
1195 1202 if not rules:
1196 comment = geteditcomment(node.short(state.parentctxnode),
1203 comment = geteditcomment(ui,
1204 node.short(state.parentctxnode),
1197 1205 node.short(state.topmost))
1198 1206 rules = ruleeditor(repo, ui, state.actions, comment)
1199 1207 else:
@@ -1234,7 +1242,7 b' def _newhistedit(ui, repo, state, revs, '
1234 1242
1235 1243 ctxs = [repo[r] for r in revs]
1236 1244 if not rules:
1237 comment = geteditcomment(node.short(root), node.short(topmost))
1245 comment = geteditcomment(ui, node.short(root), node.short(topmost))
1238 1246 actions = [pick(state, r) for r in revs]
1239 1247 rules = ruleeditor(repo, ui, actions, comment)
1240 1248 else:
General Comments 0
You need to be logged in to leave comments. Login now