comparison mercurial/cmdutil.py @ 22011:97acb4504704

import: pass 'editform' argument to 'cmdutil.getcommiteditor' This patch passes 'editform' argument according to the format below: COMMAND[.ROUTE] - ROUTE: name of route, if there are two or more routes in COMMAND In this patch, 'normal' and 'bypass' are used as ROUTE.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 02 Aug 2014 21:46:27 +0900
parents 41e969cb9468
children 9d92b9d1e282
comparison
equal deleted inserted replaced
22010:41e969cb9468 22011:97acb4504704
591 updatefunc(<repo>, <node>) 591 updatefunc(<repo>, <node>)
592 """ 592 """
593 tmpname, message, user, date, branch, nodeid, p1, p2 = \ 593 tmpname, message, user, date, branch, nodeid, p1, p2 = \
594 patch.extract(ui, hunk) 594 patch.extract(ui, hunk)
595 595
596 editor = getcommiteditor(**opts) 596 editor = getcommiteditor(editform='import.normal', **opts)
597 update = not opts.get('bypass') 597 update = not opts.get('bypass')
598 strip = opts["strip"] 598 strip = opts["strip"]
599 sim = float(opts.get('similarity') or 0) 599 sim = float(opts.get('similarity') or 0)
600 if not tmpname: 600 if not tmpname:
601 return (None, None, False) 601 return (None, None, False)
685 try: 685 try:
686 patch.patchrepo(ui, repo, p1, store, tmpname, strip, 686 patch.patchrepo(ui, repo, p1, store, tmpname, strip,
687 files, eolmode=None) 687 files, eolmode=None)
688 except patch.PatchError, e: 688 except patch.PatchError, e:
689 raise util.Abort(str(e)) 689 raise util.Abort(str(e))
690 editor = getcommiteditor(editform='import.bypass')
690 memctx = context.makememctx(repo, (p1.node(), p2.node()), 691 memctx = context.makememctx(repo, (p1.node(), p2.node()),
691 message, 692 message,
692 opts.get('user') or user, 693 opts.get('user') or user,
693 opts.get('date') or date, 694 opts.get('date') or date,
694 branch, files, store, 695 branch, files, store,
695 editor=getcommiteditor()) 696 editor=editor)
696 n = memctx.commit() 697 n = memctx.commit()
697 finally: 698 finally:
698 store.close() 699 store.close()
699 if opts.get('exact') and hex(n) != nodeid: 700 if opts.get('exact') and hex(n) != nodeid:
700 raise util.Abort(_('patch is damaged or loses information')) 701 raise util.Abort(_('patch is damaged or loses information'))