comparison mercurial/cmdutil.py @ 22250:f3200bf460a8

import: change "editform" to distinguish merge commits from others "editform" argument for "getcommiteditor" is decided according to the format below: COMMAND[.ROUTE] - COMMAND: name of command - ROUTE: name of route, if there are two or more routes in COMMAND This patch uses "normal.normal" and "normal.merge" as ROUTE of "editform" instead of "normal", to distinguish merge commits from other in "hg import" without "--bypass" case. This patch assumes "editform" variations for "hg import" below: import.normal.normal import.normal.merge import.bypass.normal import.bypass.merge Unlike other patches in this series, this patch uses "editor.sh" instead of "checkeditform.sh" for the name of the script to check "HGEDITFORM", because it has to do more than checking "HGEDITFORM". To invoke editor forcibly in "test-import-merge.t", this patch creates the patch not having patch description as "merge.nomsg.diff".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 16 Aug 2014 10:43:59 +0900
parents f5ff18f65b73
children 2229d757802d
comparison
equal deleted inserted replaced
22249:f5ff18f65b73 22250:f3200bf460a8
608 updatefunc(<repo>, <node>) 608 updatefunc(<repo>, <node>)
609 """ 609 """
610 tmpname, message, user, date, branch, nodeid, p1, p2 = \ 610 tmpname, message, user, date, branch, nodeid, p1, p2 = \
611 patch.extract(ui, hunk) 611 patch.extract(ui, hunk)
612 612
613 editor = getcommiteditor(editform='import.normal', **opts)
614 update = not opts.get('bypass') 613 update = not opts.get('bypass')
615 strip = opts["strip"] 614 strip = opts["strip"]
616 sim = float(opts.get('similarity') or 0) 615 sim = float(opts.get('similarity') or 0)
617 if not tmpname: 616 if not tmpname:
618 return (None, None, False) 617 return (None, None, False)
686 # you are doing or used --exact or a merge patch while 685 # you are doing or used --exact or a merge patch while
687 # being updated to its first parent. 686 # being updated to its first parent.
688 m = None 687 m = None
689 else: 688 else:
690 m = scmutil.matchfiles(repo, files or []) 689 m = scmutil.matchfiles(repo, files or [])
690 editform = mergeeditform(repo[None], 'import.normal')
691 editor = getcommiteditor(editform=editform, **opts)
691 n = repo.commit(message, opts.get('user') or user, 692 n = repo.commit(message, opts.get('user') or user,
692 opts.get('date') or date, match=m, 693 opts.get('date') or date, match=m,
693 editor=editor, force=partial) 694 editor=editor, force=partial)
694 else: 695 else:
695 if opts.get('exact') or opts.get('import_branch'): 696 if opts.get('exact') or opts.get('import_branch'):