2018-01-23 23:09:16 +03:00
|
|
|
$ . helpers-usechg.sh
|
|
|
|
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
Set up test environment.
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
2018-01-09 14:06:09 +03:00
|
|
|
> fbamend=
|
|
|
|
> inhibit=
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
> rebase=
|
|
|
|
> [experimental]
|
2017-10-24 05:31:43 +03:00
|
|
|
> evolution.allowdivergence = True
|
2017-07-11 01:45:31 +03:00
|
|
|
> evolution = createmarkers, allowunstable
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
> EOF
|
|
|
|
$ mkcommit() {
|
|
|
|
> echo "$1" > "$1"
|
|
|
|
> hg add "$1"
|
2017-01-31 23:48:16 +03:00
|
|
|
> hg ci -m "add $1"
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
> }
|
|
|
|
$ reset() {
|
|
|
|
> cd ..
|
2017-01-31 23:48:16 +03:00
|
|
|
> rm -rf restack
|
|
|
|
> hg init restack
|
|
|
|
> cd restack
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
> }
|
|
|
|
$ showgraph() {
|
2017-01-26 02:48:12 +03:00
|
|
|
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
> }
|
2017-01-31 23:48:16 +03:00
|
|
|
$ hg init restack && cd restack
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
Note: Repositories populated by `hg debugbuilddag` don't seem to
|
|
|
|
correctly show all commits in the log output. Manually creating the
|
|
|
|
commits results in the expected behavior, so commits are manually
|
|
|
|
created in the test cases below.
|
|
|
|
|
|
|
|
Test unsupported flags:
|
|
|
|
$ hg rebase --restack --rev .
|
|
|
|
abort: cannot use both --rev and --restack
|
|
|
|
[255]
|
|
|
|
$ hg rebase --restack --source .
|
|
|
|
abort: cannot use both --source and --restack
|
|
|
|
[255]
|
|
|
|
$ hg rebase --restack --base .
|
|
|
|
abort: cannot use both --base and --restack
|
|
|
|
[255]
|
|
|
|
$ hg rebase --restack --abort
|
|
|
|
abort: cannot use both --abort and --restack
|
|
|
|
[255]
|
|
|
|
$ hg rebase --restack --continue
|
|
|
|
abort: cannot use both --continue and --restack
|
|
|
|
[255]
|
2017-01-26 02:48:12 +03:00
|
|
|
$ hg rebase --restack --hidden
|
|
|
|
abort: cannot use both --hidden and --restack
|
|
|
|
[255]
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
Test basic case of a single amend in a small stack.
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
| o 3 add d
|
|
|
|
| |
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add d
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test multiple amends of same commit.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
|
|
|
o 2 add c
|
|
|
|
|
|
|
|
|
@ 1 add b
|
|
|
|
|
|
|
|
|
o 0 add a
|
2017-01-26 02:48:12 +03:00
|
|
|
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test conflict during rebasing.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ mkcommit e
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
|
|
|
$ echo conflict > d
|
|
|
|
$ hg add d
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 5 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
| o 4 add e
|
|
|
|
| |
|
|
|
|
| o 3 add d
|
|
|
|
| |
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
merging d
|
|
|
|
warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
$ hg rebase --restack
|
|
|
|
abort: rebase in progress
|
|
|
|
(use 'hg rebase --continue' or 'hg rebase --abort')
|
|
|
|
[255]
|
|
|
|
$ echo merged > d
|
|
|
|
$ hg resolve --mark d
|
|
|
|
(no more unresolved files)
|
|
|
|
continue: hg rebase --continue
|
|
|
|
$ hg rebase --continue
|
|
|
|
already rebased 2:4538525df7e2 "add c" as 5532778357fd
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
rebasing 4:9d206ffc875e "add e"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 8 add e
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 7 add d
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add c
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 5 add b
|
Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.
I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.
Test Plan:
See unit tests for complete commands.
1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3972103
Tasks: 13651947
Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-12 03:41:07 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test finding a stable base commit from within the old stack.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 3
|
|
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
| @ 3 add d
|
|
|
|
| |
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 6 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test finding a stable base commit from a new child of the amended commit.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ mkcommit e
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 5 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
| o 3 add d
|
|
|
|
| |
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 7 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| @ 5 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2017-09-08 19:58:14 +03:00
|
|
|
o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test finding a stable base commit when there are multiple amends and
|
|
|
|
a commit on top of one of the obsolete intermediate commits.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ mkcommit e
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add b (glob)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of c54ee8acf83d are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2017-09-08 19:58:14 +03:00
|
|
|
$ hg up 5
|
2016-10-14 21:05:53 +03:00
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| @ 5 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
| x 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
| o 3 add d
|
|
|
|
| |
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| x 1 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
2017-09-08 19:58:14 +03:00
|
|
|
rebasing 5:c1992d8998fa "add e"
|
2016-10-14 21:05:53 +03:00
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 9 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 7 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
Test that we start from the bottom of the stack. (Previously, restack would
|
|
|
|
only repair the unstable children closest to the current changeset. This
|
|
|
|
behavior is now incorrect -- restack should always fix the whole stack.)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 2
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo c >> c
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 4538525df7e2 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 3
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
| | @ 3 add d
|
|
|
|
| | |
|
2017-07-11 01:45:31 +03:00
|
|
|
+---x 2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
x | 1 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
2017-09-08 19:58:14 +03:00
|
|
|
rebasing 5:a43fcd08f41f "add c" (tip)
|
2017-11-02 21:54:31 +03:00
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
2016-10-14 21:05:53 +03:00
|
|
|
$ showgraph
|
2017-11-02 21:54:31 +03:00
|
|
|
@ 7 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
o 6 add c
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test what happens if there is no base commit found. The command should
|
|
|
|
fix up everything above the current commit, leaving other commits
|
|
|
|
below the current commit alone.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ mkcommit e
|
|
|
|
$ hg up 3
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ echo d >> d
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 47d2a3944de8 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
|
|
|
$ mkcommit f
|
|
|
|
$ hg up 1
|
|
|
|
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 6 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 5 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
| | o 4 add e
|
|
|
|
| | |
|
2017-07-11 01:45:31 +03:00
|
|
|
| | x 3 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |/
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
|
|
|
| @ 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 4:9d206ffc875e "add e"
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 7 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 6 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
o | 5 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
o | 2 add c
|
|
|
|
| |
|
|
|
|
@ | 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test having an unamended commit.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add b (glob)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend -m "Amended"
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend -m "Unamended"
|
|
|
|
$ hg unamend
|
|
|
|
$ hg up -C 1
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 3 Amended
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
|
|
|
| @ 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 3 Amended
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-07-13 21:04:56 +03:00
|
|
|
| x 1 add b
|
|
|
|
|/
|
2016-10-14 21:05:53 +03:00
|
|
|
o 0 add a
|
|
|
|
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
Test situation with divergence. Restack should rebase unstable children
|
|
|
|
onto the newest successor of their parent.
|
2016-10-14 21:05:53 +03:00
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add b (glob)
|
2017-12-28 09:54:03 +03:00
|
|
|
$ hg amend -m "successor 1" --no-rebase
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 1
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2017-12-28 09:54:03 +03:00
|
|
|
$ hg amend -m "successor 2" --no-rebase
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 1
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2016-10-14 21:05:53 +03:00
|
|
|
$ showgraph
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
o 4 successor 2
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
| o 3 successor 1
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
|
|
|
| @ 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
|
|
|
o 5 add c
|
|
|
|
|
|
|
|
|
@ 4 successor 2
|
|
|
|
|
|
|
|
|
| o 3 successor 1
|
|
|
|
|/
|
2017-07-13 21:04:56 +03:00
|
|
|
| x 1 add b
|
|
|
|
|/
|
fbamend: make restack start from bottom of the stack
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
2016-11-10 22:25:19 +03:00
|
|
|
o 0 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test situation with divergence due to an unamend. This should actually succeed
|
|
|
|
since the successor is obsolete.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add b (glob)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2017-07-11 01:45:31 +03:00
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 3 add b
|
2017-07-11 01:45:31 +03:00
|
|
|
|
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
|
|
|
| x 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 1
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo c >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2017-07-11 01:45:31 +03:00
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
2017-07-11 01:45:31 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 3 add b
|
2017-07-11 01:45:31 +03:00
|
|
|
|/
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
|
|
|
| x 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg unamend
|
2017-11-02 21:54:31 +03:00
|
|
|
$ hg up -C 3
|
2016-10-14 21:05:53 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-11-02 21:54:31 +03:00
|
|
|
@ 3 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
|
| o 2 add c
|
|
|
|
| |
|
2017-07-11 01:45:31 +03:00
|
|
|
| o 1 add b
|
|
|
|
|/
|
2016-10-14 21:05:53 +03:00
|
|
|
o 0 add a
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
Revision 2 "add c" is already stable (not orphaned) so restack does nothing:
|
|
|
|
|
|
|
|
$ hg rebase --restack
|
|
|
|
nothing to rebase - empty destination
|
|
|
|
|
2016-10-14 21:05:53 +03:00
|
|
|
Test recursive restacking -- basic case.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 2
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ echo c >> c
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 4538525df7e2 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 5 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
| | o 3 add d
|
|
|
|
| | |
|
2017-07-11 01:45:31 +03:00
|
|
|
+---x 2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
@ | 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
2017-09-08 19:58:14 +03:00
|
|
|
rebasing 5:a43fcd08f41f "add c" (tip)
|
2017-11-02 21:54:31 +03:00
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
2016-10-14 21:05:53 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-11-02 21:54:31 +03:00
|
|
|
o 7 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
o 6 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-07-13 21:04:56 +03:00
|
|
|
| x 1 add b
|
|
|
|
|/
|
2016-10-14 21:05:53 +03:00
|
|
|
o 0 add a
|
|
|
|
|
|
|
|
Test recursive restacking -- more complex case. This test is designed to
|
|
|
|
to check for a bug encountered if rebasing is performed naively from the
|
|
|
|
bottom-up wherein obsolescence information for commits further up the
|
|
|
|
stack is lost upon rebasing lower levels.
|
|
|
|
$ reset
|
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ mkcommit d
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ echo b >> b
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ mkcommit e
|
|
|
|
$ mkcommit f
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add e (glob)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo e >> e
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of c1992d8998fa are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 2
|
|
|
|
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ echo c >> c
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 4538525df7e2 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ mkcommit g
|
|
|
|
$ mkcommit h
|
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2016-11-03 21:11:37 +03:00
|
|
|
[*] add g (glob)
|
2016-10-14 21:05:53 +03:00
|
|
|
$ echo g >> g
|
|
|
|
$ hg amend
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 0261378a5dc1 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-09-08 19:58:14 +03:00
|
|
|
o 11 add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 10 add h
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
| x 9 add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2017-09-08 19:58:14 +03:00
|
|
|
o 8 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 7 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
| | o 6 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2017-09-08 19:58:14 +03:00
|
|
|
| | x 5 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |/
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
| | o 3 add d
|
|
|
|
| | |
|
2017-07-11 01:45:31 +03:00
|
|
|
+---x 2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
|
|
|
@ | 1 add b
|
|
|
|
|/
|
|
|
|
o 0 add a
|
|
|
|
$ hg rebase --restack
|
2017-09-08 19:58:14 +03:00
|
|
|
rebasing 6:2a79e3a98cd6 "add f"
|
|
|
|
rebasing 8:a43fcd08f41f "add c"
|
|
|
|
rebasing 11:604f34a1983d "add g" (tip)
|
2017-11-02 21:54:31 +03:00
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
rebasing 10:9f2a7cefd4b4 "add h"
|
2016-10-14 21:05:53 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2017-11-02 21:54:31 +03:00
|
|
|
o 16 add h
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
| o 15 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-11-02 21:54:31 +03:00
|
|
|
o | 14 add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2017-11-02 21:54:31 +03:00
|
|
|
o 13 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
| o 12 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2017-09-08 19:58:14 +03:00
|
|
|
| o 7 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2017-09-08 19:58:14 +03:00
|
|
|
@ 4 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2017-07-13 21:04:56 +03:00
|
|
|
| x 1 add b
|
|
|
|
|/
|
2016-10-14 21:05:53 +03:00
|
|
|
o 0 add a
|
2017-07-21 08:23:14 +03:00
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
Restack does topological sort and only rebases "D" once:
|
2017-07-21 08:23:14 +03:00
|
|
|
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D
|
|
|
|
> |
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
2017-12-28 09:54:03 +03:00
|
|
|
$ hg commit --amend -m B2 -q --no-rebase 2>/dev/null
|
2017-07-21 08:23:14 +03:00
|
|
|
$ hg tag --local B2
|
|
|
|
$ hg rebase -r C -d B2 -q
|
2017-12-28 09:54:03 +03:00
|
|
|
$ hg commit --amend -m B3 -q --no-rebase 2>/dev/null
|
2017-07-21 08:23:14 +03:00
|
|
|
$ hg tag --local B3
|
|
|
|
$ showgraph
|
|
|
|
@ 6 B3
|
|
|
|
|
|
|
|
|
| o 5 C
|
|
|
|
| |
|
|
|
|
| x 4 B2
|
|
|
|
|/
|
|
|
|
| o 3 D
|
|
|
|
| |
|
|
|
|
| x 2 C
|
|
|
|
| |
|
|
|
|
| x 1 B
|
|
|
|
|/
|
|
|
|
o 0 A
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 5:ca53c8ceb284 "C"
|
2017-11-02 21:54:31 +03:00
|
|
|
rebasing 3:f585351a92f8 "D" (D)
|
2017-07-21 08:23:14 +03:00
|
|
|
$ showgraph
|
2017-11-02 21:54:31 +03:00
|
|
|
o 8 D
|
2017-07-21 08:23:14 +03:00
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
o 7 C
|
2017-07-21 08:23:14 +03:00
|
|
|
|
|
|
|
|
@ 6 B3
|
|
|
|
|
|
|
|
|
| x 4 B2
|
|
|
|
|/
|
|
|
|
| x 3 D
|
|
|
|
| |
|
|
|
|
| x 2 C
|
|
|
|
| |
|
|
|
|
| x 1 B
|
|
|
|
|/
|
|
|
|
o 0 A
|
2017-11-02 21:54:31 +03:00
|
|
|
|
|
|
|
Restack will only restack the "current" stack and leave other stacks untouched.
|
|
|
|
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D H K
|
|
|
|
> | | |
|
|
|
|
> B C F G J L # amend: B -> C
|
|
|
|
> |/ |/ |/ # amend: F -> G
|
|
|
|
> A E I Z # amend: J -> L
|
|
|
|
> EOS
|
|
|
|
|
|
|
|
$ hg phase --public -r Z+I+A+E
|
|
|
|
|
|
|
|
$ hg update -q Z
|
|
|
|
$ hg rebase --restack
|
|
|
|
nothing to restack
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg update -q D
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 10:be0ef73c17ad "D" (D)
|
|
|
|
|
|
|
|
$ hg update -q G
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 11:cc209258a732 "H" (H)
|
|
|
|
|
|
|
|
$ hg update -q I
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 12:59760668f0e1 "K" (K)
|
|
|
|
|
|
|
|
$ rm .hg/localtags
|
|
|
|
$ showgraph
|
|
|
|
o 15 K
|
|
|
|
|
|
|
|
|
| o 14 H
|
|
|
|
| |
|
|
|
|
| | o 13 D
|
|
|
|
| | |
|
|
|
|
o | | 9 L
|
|
|
|
| | |
|
|
|
|
| o | 7 G
|
|
|
|
| | |
|
|
|
|
| | o 5 C
|
|
|
|
| | |
|
|
|
|
| | | o 3 Z
|
|
|
|
| | |
|
|
|
|
@ | | 2 I
|
|
|
|
/ /
|
|
|
|
o / 1 E
|
|
|
|
/
|
|
|
|
o 0 A
|
|
|
|
|
|
|
|
The "prune" cases.
|
|
|
|
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> D E
|
|
|
|
> |/
|
|
|
|
> C
|
|
|
|
> | # amend: F -> F2
|
|
|
|
> B G H # prune: A, C, F2
|
|
|
|
> | |/
|
|
|
|
> A F F2
|
|
|
|
> EOS
|
|
|
|
|
|
|
|
$ hg update -q B
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 3:112478962961 "B" (B)
|
|
|
|
rebasing 7:f585351a92f8 "D" (D)
|
|
|
|
rebasing 8:78d2dca436b2 "E" (E tip)
|
|
|
|
|
|
|
|
$ hg update -q H
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 4:8fdb2c1feb20 "G" (G)
|
|
|
|
rebasing 5:02ac06fe83b9 "H" (H)
|
|
|
|
|
|
|
|
$ rm .hg/localtags
|
|
|
|
$ showgraph
|
|
|
|
@ 13 H
|
|
|
|
|
|
|
|
o 12 G
|
|
|
|
|
|
|
|
o 11 E
|
|
|
|
|
|
|
|
|
| o 10 D
|
|
|
|
|/
|
|
|
|
o 9 B
|
|
|
|
|
2018-02-14 00:36:51 +03:00
|
|
|
|
|
|
|
|
2017-11-02 21:54:31 +03:00
|
|
|
Restack could resume after resolving merge conflicts.
|
|
|
|
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> F G # F/C = F # cause conflict
|
|
|
|
> | | # G/E = G # cause conflict
|
|
|
|
> B C D E # amend: B -> C
|
|
|
|
> |/ |/ # amend: D -> E
|
|
|
|
> | /
|
|
|
|
> | /
|
|
|
|
> | /
|
|
|
|
> |/
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
|
|
|
|
$ hg update -q F
|
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 5:ed8545a5c22a "F" (F)
|
|
|
|
merging C
|
|
|
|
warning: conflicts while merging C! (edit, then use 'hg resolve --mark')
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ rm .hg/localtags
|
|
|
|
|
|
|
|
$ echo R > C
|
|
|
|
$ hg resolve --mark -q
|
|
|
|
continue: hg rebase --continue
|
|
|
|
$ hg rebase --continue
|
|
|
|
rebasing 5:ed8545a5c22a "F"
|
|
|
|
rebasing 6:4d1ef7d890c5 "G" (tip)
|
|
|
|
merging E
|
|
|
|
warning: conflicts while merging E! (edit, then use 'hg resolve --mark')
|
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ echo R > E
|
|
|
|
$ hg resolve --mark -q
|
|
|
|
continue: hg rebase --continue
|
|
|
|
$ hg rebase --continue
|
|
|
|
already rebased 5:ed8545a5c22a "F" as 2282fe522d5c
|
|
|
|
rebasing 6:4d1ef7d890c5 "G"
|
|
|
|
|
|
|
|
$ showgraph
|
|
|
|
o 8 G
|
|
|
|
|
|
|
|
|
| @ 7 F
|
|
|
|
| |
|
|
|
|
o | 4 E
|
|
|
|
| |
|
|
|
|
| o 2 C
|
|
|
|
|/
|
|
|
|
o 0 A
|
2017-12-28 09:54:03 +03:00
|
|
|
|
|
|
|
Test auto-restack heuristics - no changes to manifest and clean working directory
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m 'Unchanged manifest for B'
|
|
|
|
rebasing 2:26805aba1e60 "C" (C)
|
2018-04-07 10:36:54 +03:00
|
|
|
hint[amend-autorebase]: descendants have been auto-rebased because no merge conflict could have happened - use --no-rebase or set commands.amend.autorebase=False to disable auto rebase
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-autorebase' to silence these hints
|
2017-12-28 09:54:03 +03:00
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
[426bad] A
|
|
|
|
$ hg amend -m 'Unchanged manifest for A'
|
|
|
|
rebasing 3:5357953e3ea3 "Unchanged manifest for B"
|
|
|
|
rebasing 4:b635bd2cf20b "C"
|
2018-04-07 10:36:54 +03:00
|
|
|
hint[amend-autorebase]: descendants have been auto-rebased because no merge conflict could have happened - use --no-rebase or set commands.amend.autorebase=False to disable auto rebase
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-autorebase' to silence these hints
|
2017-12-28 09:54:03 +03:00
|
|
|
|
2018-02-14 00:36:51 +03:00
|
|
|
Test commands.amend.autorebase=False flag - no changes to manifest and clean working directory
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend --config commands.amend.autorebase=False -m 'Unchanged manifest for B'
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2018-02-14 00:36:51 +03:00
|
|
|
$ hg prev
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
[426bad] A
|
|
|
|
$ hg amend --config commands.amend.autorebase=False -m 'Unchanged manifest for A'
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 426bada5c675 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2018-02-14 00:36:51 +03:00
|
|
|
|
2017-12-28 09:54:03 +03:00
|
|
|
Test auto-restack heuristics - manifest changes
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'new b' > B
|
|
|
|
$ hg amend -m 'Change manifest for B'
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2017-12-28 09:54:03 +03:00
|
|
|
|
|
|
|
Test auto-restack heuristics - no committed changes to manifest but dirty working directory
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ echo 'new b' > B
|
|
|
|
$ hg amend a -m 'Unchanged manifest, but dirty workdir'
|
2018-04-07 10:36:52 +03:00
|
|
|
hint[amend-restack]: descendants of 112478962961 are left behind - use 'hg restack' to rebase them
|
|
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
2017-12-28 09:54:03 +03:00
|
|
|
|
|
|
|
Test auto-restack heuristics - no changes to manifest but no children
|
|
|
|
$ reset
|
|
|
|
$ hg debugdrawdag<<'EOS'
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
$ hg update B -q
|
|
|
|
$ hg amend -m 'Unchanged manifest for B'
|