sapling/tests/test-fbamend-next.t

258 lines
6.5 KiB
Perl
Raw Normal View History

fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
Set up test environment.
$ cat >> $HGRCPATH << EOF
> [extensions]
> fbamend=$TESTDIR/../hgext3rd/fbamend
> inhibit=$TESTDIR/../hgext3rd/inhibit.py
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
> rebase=
> [experimental]
> evolution = createmarkers
> EOF
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ showgraph() {
> hg log --graph -T "{rev} {bookmarks} {desc|firstline}" | sed \$d
> }
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
$ hg init fbamendnext && cd fbamendnext
Check help text for new options and removal of unsupported options.
$ hg next --help
hg next [OPTIONS]... [STEPS]
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
update to child changeset
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
options:
--clean discard uncommitted changes (no backup)
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
--newest always pick the newest child when a changeset has
multiple children
--rebase rebase each changeset if necessary
--top update to the head of the current stack
--bookmark update to the first changeset with a bookmark
--no-activate-bookmark do not activate the bookmark on the destination
changeset
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
--towards VALUE move linearly towards the specified head
-B --move-bookmark move active bookmark
--merge merge uncommitted changes
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
(some details hidden, use --verbose to show complete help)
Create stack of commits and go to the bottom.
$ hg debugbuilddag +6
$ hg up 1ea734
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg book bottom
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ showgraph
o 5 r5
|
o 4 r4
|
o 3 r3
|
o 2 r2
|
o 1 r1
|
@ 0 bottom r0
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
Test invalid argument combinations.
$ hg next --top 1
abort: cannot use both number and --top
[255]
$ hg next --bookmark 1
abort: cannot use both number and --bookmark
[255]
$ hg next --top --bookmark
abort: cannot use both --top and --bookmark
[255]
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ hg next --top --towards top
abort: cannot use both --top and --towards
[255]
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
Test basic usage.
$ hg next
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[66f7d4] r1
With positional argument.
$ hg next 2
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[2dc09a] r3
Overshoot top of repo.
$ hg next 5
reached head changeset
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[c8d03c] r5
Test --top flag.
$ hg up bottom
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark bottom)
$ hg next --top
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[c8d03c] r5
Test bookmark navigation.
$ hg book -r c8d03c top
$ hg book -r 2dc09a bookmark
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ showgraph
@ 5 top r5
|
o 4 r4
|
o 3 bookmark r3
|
o 2 r2
|
o 1 r1
|
o 0 bottom r0
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
$ hg up bottom
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark bottom)
$ hg next --bookmark
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[2dc09a] (bookmark) r3
(activating bookmark bookmark)
$ hg next --bookmark
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bookmark)
[c8d03c] (top) r5
(activating bookmark top)
Test bookmark activation.
$ hg up bottom
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark bottom)
$ hg next 3
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[2dc09a] (bookmark) r3
(activating bookmark bookmark)
$ hg next 2 --no-activate-bookmark
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bookmark)
[c8d03c] (top) r5
Test dirty working copy and --clean.
$ hg up bottom
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark bottom)
$ touch test
$ hg add test
$ hg st
A test
$ hg next
abort: uncommitted changes
(use --clean to discard uncommitted changes or --merge to bring them along)
[255]
$ hg next --clean
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[66f7d4] r1
$ hg st
? test
$ rm test
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
Test dirty working copy and --merge.
$ hg up bottom
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark bottom)
$ touch test
$ hg add test
$ hg st
A test
$ hg next
abort: uncommitted changes
(use --clean to discard uncommitted changes or --merge to bring them along)
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
[255]
$ hg next --merge
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[66f7d4] r1
$ hg st
A test
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ hg forget test
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
Test --newest flag.
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ hg up 3
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ touch test
$ hg add test
$ hg commit -m "test"
created new head
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
$ hg book other
$ showgraph
@ 6 other test
|
| o 5 top r5
| |
| o 4 r4
|/
o 3 bookmark r3
|
o 2 r2
|
o 1 r1
|
o 0 bottom r0
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
$ hg up bottom
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(activating bookmark bottom)
$ hg next --top
current stack has multiple heads, namely:
[c8d03c] (top) r5
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
[10f4a7] (other) test
fbamend: add new implementations of `hg previous` and `hg next` Summary: This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve: - Users can now move by multiple commits at a time. Example: `hg next 3` - Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom` - Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack) - When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag. - The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step. - The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on. Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up. Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected. Reviewers: quark, #sourcecontrol, durham Reviewed By: durham Subscribers: stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4121778 Tasks: 14119420 Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
2016-11-16 05:46:56 +03:00
abort: ambiguous next changeset
(use the --newest flag to always pick the newest child at each step)
[255]
$ hg log -r .
changeset: 0:1ea73414a91b
bookmark: bottom
user: debugbuilddag
date: Thu Jan 01 00:00:00 1970 +0000
summary: r0
$ hg next --top --newest
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
fbamend: add --towards flag to hg next Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`. Test Plan: Here is an example of basic usage. Also see test file. ``` $ hg debugbuilddag "+5 *2 +2" $ hg book -r 4 feature1 $ hg book -r 7 feature2 $ hg up 0 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | o 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | @ 1ea734 debugbuilddag r0 $ hg next 3 --towards feature1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [2dc09a] r3 $ hg sl o 92eaf3 debugbuilddag feature2 | r7 | o 8bbe84 debugbuilddag | r6 | o 914970 debugbuilddag | r5 | | o bebd16 debugbuilddag feature1 | | r4 | | | @ 2dc09a debugbuilddag | | r3 | | | o 012414 debugbuilddag |/ r2 | o 66f7d4 debugbuilddag | r1 | o 1ea734 debugbuilddag r0 ``` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: simonfar, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4695861 Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
2017-03-12 20:09:12 +03:00
[10f4a7] (other) test
(activating bookmark other)
Test --towards flag.
$ hg up bottom
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(activating bookmark bottom)
$ showgraph
o 6 other test
|
| o 5 top r5
| |
| o 4 r4
|/
o 3 bookmark r3
|
o 2 r2
|
o 1 r1
|
@ 0 bottom r0
$ hg next 4 --towards 1
changeset 2dc09a01254d has multiple children, namely:
[bebd16] r4
[10f4a7] (other) test
abort: ambiguous next changeset
(use the --newest or --towards flags to specify which child to pick)
[255]
$ hg next 4 --towards 'top+other'
abort: 'top+other' refers to multiple changesets
[255]
$ hg next 4 --towards top
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
(leaving bookmark bottom)
[bebd16] r4
$ hg next --towards other
abort: the current changeset is not an ancestor of 'other'
[255]