7 |
7 |
8 '''patch transplanting tool |
8 '''patch transplanting tool |
9 |
9 |
10 This extension allows you to transplant patches from another branch. |
10 This extension allows you to transplant patches from another branch. |
11 |
11 |
12 Transplanted patches are recorded in .hg/transplant/transplants, as a map |
12 Transplanted patches are recorded in .hg/transplant/transplants, as a |
13 from a changeset hash to its hash in the source repository. |
13 map from a changeset hash to its hash in the source repository. |
14 ''' |
14 ''' |
15 |
15 |
16 from mercurial.i18n import _ |
16 from mercurial.i18n import _ |
17 import os, tempfile |
17 import os, tempfile |
18 from mercurial import bundlerepo, changegroup, cmdutil, hg, merge |
18 from mercurial import bundlerepo, changegroup, cmdutil, hg, merge |
437 specified, log messages will have a comment appended of the form: |
437 specified, log messages will have a comment appended of the form: |
438 |
438 |
439 (transplanted from CHANGESETHASH) |
439 (transplanted from CHANGESETHASH) |
440 |
440 |
441 You can rewrite the changelog message with the --filter option. |
441 You can rewrite the changelog message with the --filter option. |
442 Its argument will be invoked with the current changelog message |
442 Its argument will be invoked with the current changelog message as |
443 as $1 and the patch as $2. |
443 $1 and the patch as $2. |
444 |
444 |
445 If --source is specified, selects changesets from the named |
445 If --source is specified, selects changesets from the named |
446 repository. If --branch is specified, selects changesets from the |
446 repository. If --branch is specified, selects changesets from the |
447 branch holding the named revision, up to that revision. If --all |
447 branch holding the named revision, up to that revision. If --all |
448 is specified, all changesets on the branch will be transplanted, |
448 is specified, all changesets on the branch will be transplanted, |
449 otherwise you will be prompted to select the changesets you want. |
449 otherwise you will be prompted to select the changesets you want. |
450 |
450 |
451 hg transplant --branch REVISION --all will rebase the selected branch |
451 hg transplant --branch REVISION --all will rebase the selected |
452 (up to the named revision) onto your current working directory. |
452 branch (up to the named revision) onto your current working |
453 |
453 directory. |
454 You can optionally mark selected transplanted changesets as |
454 |
455 merge changesets. You will not be prompted to transplant any |
455 You can optionally mark selected transplanted changesets as merge |
456 ancestors of a merged transplant, and you can merge descendants |
456 changesets. You will not be prompted to transplant any ancestors |
457 of them normally instead of transplanting them. |
457 of a merged transplant, and you can merge descendants of them |
|
458 normally instead of transplanting them. |
458 |
459 |
459 If no merges or revisions are provided, hg transplant will start |
460 If no merges or revisions are provided, hg transplant will start |
460 an interactive changeset browser. |
461 an interactive changeset browser. |
461 |
462 |
462 If a changeset application fails, you can fix the merge by hand and |
463 If a changeset application fails, you can fix the merge by hand |
463 then resume where you left off by calling hg transplant --continue. |
464 and then resume where you left off by calling hg transplant |
|
465 --continue. |
464 ''' |
466 ''' |
465 def getremotechanges(repo, url): |
467 def getremotechanges(repo, url): |
466 sourcerepo = ui.expandpath(url) |
468 sourcerepo = ui.expandpath(url) |
467 source = hg.repository(ui, sourcerepo) |
469 source = hg.repository(ui, sourcerepo) |
468 common, incoming, rheads = repo.findcommonincoming(source, force=True) |
470 common, incoming, rheads = repo.findcommonincoming(source, force=True) |