Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow simultaneous rebasing of duplicate commits, duplicating multiple commits, undo after duplicate #1049

Merged
merged 8 commits into from
Jan 18, 2023

Conversation

ilyagr
Copy link
Contributor

@ilyagr ilyagr commented Jan 15, 2023

Fixes #27, #694 and #1050

I combined the bugfix PRs with the feature PR into one since they are both ready. If a portion of this PR gets a faster review than the rest, I'll split them again.

Now also includes a minor fix to jj abandon: if the same revision is specified several times, it is now only listed once in the output.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • Updated command-line help
  • I have added tests to cover my changes

@ilyagr
Copy link
Contributor Author

ilyagr commented Jan 16, 2023

I made this a draft until I figure out whether we can fix #1050 or I should work around it by not using undo in tests.

Update: Martin helped me fix the bug. Thank you!

lib/src/store.rs Outdated Show resolved Hide resolved
@ilyagr ilyagr changed the title Allow simultaneous rebasing of duplicate commits Allow simultaneous rebasing of duplicate commits, duplicating multiple commits, undo after duplicate Jan 16, 2023
@ilyagr ilyagr force-pushed the ig/rebase-dup branch 2 times, most recently from e6aca27 to 549acce Compare January 16, 2023 20:25
@ilyagr ilyagr marked this pull request as ready for review January 16, 2023 20:25
@ilyagr ilyagr linked an issue Jan 16, 2023 that may be closed by this pull request
@ilyagr ilyagr force-pushed the ig/rebase-dup branch 8 times, most recently from 2fa1275 to cadb2fe Compare January 16, 2023 21:22
Copy link
Member

@martinvonz martinvonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't finish reviewing the last two commits. I'll probably get around to that later tonight.

tests/test_duplicate_command.rs Outdated Show resolved Hide resolved
lib/src/store.rs Outdated Show resolved Hide resolved
src/commands.rs Outdated Show resolved Hide resolved
tests/test_duplicate_command.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@ilyagr ilyagr force-pushed the ig/rebase-dup branch 7 times, most recently from 20d885a to adec189 Compare January 16, 2023 23:06
@ilyagr ilyagr force-pushed the ig/rebase-dup branch 7 times, most recently from cd1d0ab to 41e6d5a Compare January 17, 2023 00:54
@ilyagr ilyagr linked an issue Jan 17, 2023 that may be closed by this pull request
src/commands.rs Outdated Show resolved Hide resolved
lib/src/git_backend.rs Show resolved Hide resolved
src/commands.rs Outdated Show resolved Hide resolved
src/commands.rs Show resolved Hide resolved
Fixes #1050

Thanks to Martin for suggesting the exact fix.

The tests go into the new tests/test_duplicate_command.rs, which will be
expanded shortly with other tests depending on this bugfix.
The `indexmap` crate is used to make `duplicate`'s output have a sane order,
making it easier to test.

It's also used later to remove duplicate revisions in the `abandon` command.
@ilyagr
Copy link
Contributor Author

ilyagr commented Jan 18, 2023

Thank you for the review and the help! :)

@ilyagr ilyagr merged commit 3e7791b into main Jan 18, 2023
@ilyagr ilyagr deleted the ig/rebase-dup branch January 18, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants