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.
|
2018-07-02 21:27:20 +03:00
|
|
|
|
2018-10-11 16:55:19 +03:00
|
|
|
$ enable amend rebase
|
2018-07-02 21:27:20 +03:00
|
|
|
$ setconfig experimental.evolution.allowdivergence=True
|
|
|
|
$ setconfig experimental.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
|
|
|
$ 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
|
|
|
> }
|
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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c54ee8acf83d 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 47d2a3944de8 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc 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
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 a5821d37b1b7 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 1764a93dcfdf 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c54ee8acf83d 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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 multiple amends of same commit.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
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
|
|
|
$ mkcommit a
|
|
|
|
$ mkcommit b
|
|
|
|
$ mkcommit c
|
|
|
|
$ hg up 1
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 2 4538525df7e2 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 1 7c3bad9141dc 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c4c2e155d8e8 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc 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
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 81909827477c 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c4c2e155d8e8 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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 conflict during rebasing.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
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
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 5 f19e51f4d5ab 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 4 9d206ffc875e 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 47d2a3944de8 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 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
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc 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
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
merging d
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging d! (edit, then use 'hg resolve --mark')
|
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
|
|
|
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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 8 661cf3d06b05 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 7 fa39a0ff8b82 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 5532778357fd 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 5 f19e51f4d5ab 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test finding a stable base commit from within the old stack.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| @ 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 6 a5821d37b1b7 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 1764a93dcfdf add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test finding a stable base commit from a new child of the amended commit.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 5 c1992d8998fa add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
rebasing 3:47d2a3944de8 "add d"
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 7 a5821d37b1b7 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 1764a93dcfdf add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| @ 5 c1992d8998fa add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test finding a stable base commit when there are multiple amends and
|
|
|
|
a commit on top of one of the obsolete intermediate commits.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 c4c2e155d8e8 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| @ 5 c1992d8998fa add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 9 d52a0251f17f add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 8 98270af1e2d8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 7 81909827477c add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 c4c2e155d8e8 add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
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
|
|
|
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.)
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 a43fcd08f41f add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | @ 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
+---x 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
x | 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 7 eb17ba71882a add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 036064f96b60 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
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
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.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 79bfbab36011 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 5 c5b31a43cdc5 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | o 4 9d206ffc875e add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | x 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |/
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| @ 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 4:9d206ffc875e "add e"
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 7 2f4697538c37 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 6 79bfbab36011 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
o | 5 c5b31a43cdc5 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
o | 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
@ | 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
Test having an unamended commit.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 3 a5c6a6c11eb6 Amended
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| @ 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ hg rebase --restack
|
|
|
|
rebasing 2:4538525df7e2 "add c"
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ showgraph
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 34b2b8ed2689 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 3 a5c6a6c11eb6 Amended
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2017-07-13 21:04:56 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
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.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 5 a43fcd08f41f add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | o 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
+---x 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
@ | 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 7 eb17ba71882a add d
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
o 6 036064f96b60 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2017-07-13 21:04:56 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
|
|
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.
|
2018-07-02 21:27:20 +03:00
|
|
|
$ newrepo
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 11 604f34a1983d add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 10 9f2a7cefd4b4 add h
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 9 0261378a5dc1 add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 8 a43fcd08f41f add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 7 581ab389e415 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | o 6 2a79e3a98cd6 add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | x 5 c1992d8998fa add e
|
2016-10-14 21:05:53 +03:00
|
|
|
| |/
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| | o 3 47d2a3944de8 add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| | |
|
2018-08-15 09:13:17 +03:00
|
|
|
+---x 2 4538525df7e2 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
@ | 1 7c3bad9141dc add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|
2016-10-14 21:05:53 +03:00
|
|
|
$ 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
|
2018-08-15 09:13:17 +03:00
|
|
|
o 16 02e6213e1c27 add h
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 15 eb17ba71882a add d
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
o | 14 cc14f12b1775 add g
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 13 036064f96b60 add c
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 12 d27ae4ec354c add f
|
2016-10-14 21:05:53 +03:00
|
|
|
| |
|
2018-08-15 09:13:17 +03:00
|
|
|
| o 7 581ab389e415 add e
|
2016-10-14 21:05:53 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
@ 4 c54ee8acf83d add b
|
2016-10-14 21:05:53 +03:00
|
|
|
|
|
2018-08-15 09:13:17 +03:00
|
|
|
| x 1 7c3bad9141dc add b
|
2017-07-13 21:04:56 +03:00
|
|
|
|/
|
2018-08-15 09:13:17 +03:00
|
|
|
o 0 1f0dee641bb7 add a
|