Show More
@@ -86,7 +86,10 class transplanter(object): | |||||
86 | self.opener = scmutil.opener(self.path) |
|
86 | self.opener = scmutil.opener(self.path) | |
87 | self.transplants = transplants(self.path, 'transplants', |
|
87 | self.transplants = transplants(self.path, 'transplants', | |
88 | opener=self.opener) |
|
88 | opener=self.opener) | |
89 | self.editor = cmdutil.getcommiteditor(editform='transplant', **opts) |
|
89 | def getcommiteditor(): | |
|
90 | editform = cmdutil.mergeeditform(repo[None], 'transplant') | |||
|
91 | return cmdutil.getcommiteditor(editform=editform, **opts) | |||
|
92 | self.getcommiteditor = getcommiteditor | |||
90 |
|
93 | |||
91 | def applied(self, repo, node, parent): |
|
94 | def applied(self, repo, node, parent): | |
92 | '''returns True if a node is already an ancestor of parent |
|
95 | '''returns True if a node is already an ancestor of parent | |
@@ -286,7 +289,7 class transplanter(object): | |||||
286 | m = match.exact(repo.root, '', files) |
|
289 | m = match.exact(repo.root, '', files) | |
287 |
|
290 | |||
288 | n = repo.commit(message, user, date, extra=extra, match=m, |
|
291 | n = repo.commit(message, user, date, extra=extra, match=m, | |
289 | editor=self.editor) |
|
292 | editor=self.getcommiteditor()) | |
290 | if not n: |
|
293 | if not n: | |
291 | self.ui.warn(_('skipping emptied changeset %s\n') % short(node)) |
|
294 | self.ui.warn(_('skipping emptied changeset %s\n') % short(node)) | |
292 | return None |
|
295 | return None | |
@@ -342,7 +345,7 class transplanter(object): | |||||
342 | if merge: |
|
345 | if merge: | |
343 | repo.setparents(p1, parents[1]) |
|
346 | repo.setparents(p1, parents[1]) | |
344 | n = repo.commit(message, user, date, extra=extra, |
|
347 | n = repo.commit(message, user, date, extra=extra, | |
345 | editor=self.editor) |
|
348 | editor=self.getcommiteditor()) | |
346 | if not n: |
|
349 | if not n: | |
347 | raise util.Abort(_('commit failed')) |
|
350 | raise util.Abort(_('commit failed')) | |
348 | if not merge: |
|
351 | if not merge: |
@@ -417,7 +417,8 messages for each actions. | |||||
417 | - ``changeset.shelve.shelve`` for :hg:`shelve` |
|
417 | - ``changeset.shelve.shelve`` for :hg:`shelve` | |
418 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` |
|
418 | - ``changeset.tag.add`` for :hg:`tag` without ``--remove`` | |
419 | - ``changeset.tag.remove`` for :hg:`tag --remove` |
|
419 | - ``changeset.tag.remove`` for :hg:`tag --remove` | |
420 | - ``changeset.transplant`` for :hg:`transplant` |
|
420 | - ``changeset.transplant.merge`` for :hg:`transplant` on merges | |
|
421 | - ``changeset.transplant.normal`` for :hg:`transplant` on other | |||
421 |
|
422 | |||
422 | These dot-separated lists of names are treated as hierarchical ones. |
|
423 | These dot-separated lists of names are treated as hierarchical ones. | |
423 | For example, ``changeset.tag.remove`` customizes the commit message |
|
424 | For example, ``changeset.tag.remove`` customizes the commit message |
@@ -95,8 +95,13 clone so subsequent rollback isn't affec | |||||
95 | $ hg ci -qm "b4" |
|
95 | $ hg ci -qm "b4" | |
96 | $ hg status --rev "7^1" --rev 7 |
|
96 | $ hg status --rev "7^1" --rev 7 | |
97 | A b3 |
|
97 | A b3 | |
98 | $ HGEDITOR=cat hg transplant --edit 7 |
|
98 | $ cat > $TESTTMP/checkeditform.sh <<EOF | |
|
99 | > env | grep HGEDITFORM | |||
|
100 | > true | |||
|
101 | > EOF | |||
|
102 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7 | |||
99 | applying ffd6818a3975 |
|
103 | applying ffd6818a3975 | |
|
104 | HGEDITFORM=transplant.normal | |||
100 | b3 |
|
105 | b3 | |
101 |
|
106 | |||
102 |
|
107 | |||
@@ -373,7 +378,8 transplant -c shouldn't use an old chang | |||||
373 | patch failed to apply |
|
378 | patch failed to apply | |
374 | abort: fix up the merge and run hg transplant --continue |
|
379 | abort: fix up the merge and run hg transplant --continue | |
375 | [255] |
|
380 | [255] | |
376 | $ hg transplant --continue |
|
381 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e | |
|
382 | HGEDITFORM=transplant.normal | |||
377 | 46ae92138f3c transplanted as 9159dada197d |
|
383 | 46ae92138f3c transplanted as 9159dada197d | |
378 | $ hg transplant 1:3 |
|
384 | $ hg transplant 1:3 | |
379 | skipping already applied revision 1:46ae92138f3c |
|
385 | skipping already applied revision 1:46ae92138f3c | |
@@ -430,9 +436,30 Issue1111: Test transplant --merge | |||||
430 |
|
436 | |||
431 |
|
|
437 | transplant | |
432 |
|
438 | |||
433 | $ hg transplant -m 1 |
|
439 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e | |
434 | applying 42dc4432fd35 |
|
440 | applying 42dc4432fd35 | |
|
441 | HGEDITFORM=transplant.merge | |||
435 | 1:42dc4432fd35 merged at a9f4acbac129 |
|
442 | 1:42dc4432fd35 merged at a9f4acbac129 | |
|
443 | $ hg update -q -C 2 | |||
|
444 | $ cat > a <<EOF | |||
|
445 | > x | |||
|
446 | > y | |||
|
447 | > z | |||
|
448 | > EOF | |||
|
449 | $ hg commit -m replace | |||
|
450 | $ hg update -q -C 4 | |||
|
451 | $ hg transplant -m 5 | |||
|
452 | applying 600a3cdcb41d | |||
|
453 | patching file a | |||
|
454 | Hunk #1 FAILED at 0 | |||
|
455 | 1 out of 1 hunks FAILED -- saving rejects to file a.rej | |||
|
456 | patch failed to apply | |||
|
457 | abort: fix up the merge and run hg transplant --continue | |||
|
458 | [255] | |||
|
459 | $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e | |||
|
460 | HGEDITFORM=transplant.merge | |||
|
461 | 600a3cdcb41d transplanted as a3f88be652e0 | |||
|
462 | ||||
436 | $ cd .. |
|
463 | $ cd .. | |
437 |
|
464 | |||
438 | test transplant into empty repository |
|
465 | test transplant into empty repository |
General Comments 0
You need to be logged in to leave comments.
Login now