Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG94a4980695f8: rebase: skip extinct revisions even if it has no successor in rebase set
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/rebase.py (2 lines) | |||
| M | tests/test-rebase-obsolete.t (6 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| Martin von Zweigbergk | Jul 12 2018, 3:11 PM |
| Status | Author | Revision | |
|---|---|---|---|
| Needs Revision | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz | ||
| Closed | martinvonz |
| for succrev in succrevs: | for succrev in succrevs: | ||||
| if cl.isancestorrev(succrev, dstrev): | if cl.isancestorrev(succrev, dstrev): | ||||
| obsoletenotrebased[srcrev] = succrev | obsoletenotrebased[srcrev] = succrev | ||||
| break | break | ||||
| else: | else: | ||||
| # If 'srcrev' has a successor in rebase set but none in | # If 'srcrev' has a successor in rebase set but none in | ||||
| # destination (which would be catched above), we shall skip it | # destination (which would be catched above), we shall skip it | ||||
| # and its descendants to avoid divergence. | # and its descendants to avoid divergence. | ||||
| if any(s in destmap for s in succrevs): | if srcrev in extinctrevs or any(s in destmap for s in succrevs): | ||||
| obsoletewithoutsuccessorindestination.add(srcrev) | obsoletewithoutsuccessorindestination.add(srcrev) | ||||
| return ( | return ( | ||||
| obsoletenotrebased, | obsoletenotrebased, | ||||
| obsoletewithoutsuccessorindestination, | obsoletewithoutsuccessorindestination, | ||||
| obsoleteextinctsuccessors, | obsoleteextinctsuccessors, | ||||
| ) | ) | ||||
| $ hg debugdrawdag <<EOF | $ hg debugdrawdag <<EOF | ||||
| > E C # replace: C -> E | > E C # replace: C -> E | ||||
| > | | | > | | | ||||
| > D B | > D B | ||||
| > |/ | > |/ | ||||
| > A | > A | ||||
| > EOF | > EOF | ||||
| TODO: There doesn't seem to be much reason to fail this rebase. Make it pass? | |||||
| $ hg rebase -d D -s B | $ hg rebase -d D -s B | ||||
| abort: this rebase will cause divergences from: 26805aba1e60 | rebasing 1:112478962961 "B" (B) | ||||
| (to force the rebase please set experimental.evolution.allowdivergence=True) | note: not rebasing 3:26805aba1e60 "C" (C) and its descendants as this would cause divergence | ||||
| [255] | |||||
| $ cd .. | $ cd .. | ||||
| $ hg init p2-succ-in-dest-c | $ hg init p2-succ-in-dest-c | ||||
| $ cd p2-succ-in-dest-c | $ cd p2-succ-in-dest-c | ||||
| The scenario here was that B::D were developed on default. B was queued on | The scenario here was that B::D were developed on default. B was queued on | ||||
| stable, but amended before being push to hg-committed. C was queued on default, | stable, but amended before being push to hg-committed. C was queued on default, | ||||