Mercurial > public > mercurial-scm > hg
diff hgext/transplant.py @ 22252:de783f2403c4
transplant: change "editform" to distinguish merge commits from others
"editform" argument for "getcommiteditor" is decided according to the
format below:
EXTENSION[.COMMAND][.ROUTE]
- EXTENSION: name of extension
- COMMAND: name of command, if there are two or more commands in EXTENSION
- ROUTE: name of route, if there are two or more routes in COMMAND
This patch newly adds "normal" and "merge" as ROUTE, to distinguish
merge commits from other.
This patch adds 4 test patterns to test combination of "merge"(x2) and
"--continue"(x2).
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 16 Aug 2014 10:43:59 +0900 |
parents | 7e71a65bf94f |
children | 74da54e52d7c |
line wrap: on
line diff
--- a/hgext/transplant.py Sat Aug 16 10:43:59 2014 +0900 +++ b/hgext/transplant.py Sat Aug 16 10:43:59 2014 +0900 @@ -86,7 +86,10 @@ self.opener = scmutil.opener(self.path) self.transplants = transplants(self.path, 'transplants', opener=self.opener) - self.editor = cmdutil.getcommiteditor(editform='transplant', **opts) + def getcommiteditor(): + editform = cmdutil.mergeeditform(repo[None], 'transplant') + return cmdutil.getcommiteditor(editform=editform, **opts) + self.getcommiteditor = getcommiteditor def applied(self, repo, node, parent): '''returns True if a node is already an ancestor of parent @@ -286,7 +289,7 @@ m = match.exact(repo.root, '', files) n = repo.commit(message, user, date, extra=extra, match=m, - editor=self.editor) + editor=self.getcommiteditor()) if not n: self.ui.warn(_('skipping emptied changeset %s\n') % short(node)) return None @@ -342,7 +345,7 @@ if merge: repo.setparents(p1, parents[1]) n = repo.commit(message, user, date, extra=extra, - editor=self.editor) + editor=self.getcommiteditor()) if not n: raise util.Abort(_('commit failed')) if not merge: