##// END OF EJS Templates
histedit: add torule method to histedit action objects...
Mateusz Kwapich -
r27203:b6a0f089 default
parent child Browse files
Show More
@@ -359,6 +359,23 b' class histeditaction(object):'
359 raise error.Abort(_('unknown changeset %s listed')
359 raise error.Abort(_('unknown changeset %s listed')
360 % ha[:12])
360 % ha[:12])
361
361
362 def torule(self):
363 """build a histedit rule line for an action
364
365 by default lines are in the form:
366 <hash> <rev> <summary>
367 """
368 ctx = self.repo[self.node]
369 summary = ''
370 if ctx.description():
371 summary = ctx.description().splitlines()[0]
372 line = '%s %s %d %s' % (self.verb, ctx, ctx.rev(), summary)
373 # trim to 75 columns by default so it's not stupidly wide in my editor
374 # (the 5 more are left for verb)
375 maxlen = self.repo.ui.configint('histedit', 'linelen', default=80)
376 maxlen = max(maxlen, 22) # avoid truncating hash
377 return util.ellipsis(line, maxlen)
378
362 def constraints(self):
379 def constraints(self):
363 """Return a set of constrains that this action should be verified for
380 """Return a set of constrains that this action should be verified for
364 """
381 """
General Comments 0
You need to be logged in to leave comments. Login now