jj/tests
Yuya Nishihara fb33620f9e revset_graph: group commits topologically
The original idea was similar to Mercurial's "topo" sorting, but it was bad
at handling merge-heavy history. In order to render merges of topic branches
nicely, we need to prioritize branches at merge point, not at fork point.
OTOH, we do also want to place unmerged branches as close to the fork point
as possible. This commit implements the former requirement, and the latter
will be addressed by the next commit.

I think this is similar to Git's sorting logic described in the following blog
post. In our case, the in-degree walk can be dumb since topological order is
guaranteed by the index. We keep HashSet<CommitId> instead of an in-degree
integer value, which will be used in the next commit to resolve new heads as
late as possible.

https://github.blog/2022-08-30-gits-database-internals-ii-commit-history-queries/#topological-sorting

Compared to Sapling's beautify_graph(), this is lazy, and can roughly preserve
the index (or chronological) order. I tried beautify_graph() with prioritizing
the @ commit, but the result seemed too aggressively reordered. Perhaps, for
more complex history, beautify_graph() would produce a better result. For my
wip branches (~30 branches, a couple of commits per branch), this works pretty
well.

#242
2023-07-25 01:45:37 +09:00
..
common test utilities: advance_test_rng_seed_to_multiple_of function 2023-07-03 12:28:06 -07:00
test_abandon_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_alias.rs
test_branch_command.rs revset: include pseudo @git remote in suggestion 2023-07-10 06:17:44 +09:00
test_cat_command.rs
test_checkout.rs
test_chmod_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_commit_command.rs
test_commit_template.rs cli: render HEAD@git in green instead of bright green 2023-07-11 08:04:46 -05:00
test_concurrent_operations.rs
test_config_command.rs tests: add helper method to capture both stdout/stderr outputs 2023-07-03 22:03:05 +09:00
test_debug_command.rs
test_describe_command.rs
test_diff_command.rs
test_diffedit_command.rs
test_duplicate_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_edit_command.rs
test_git_clone.rs
test_git_colocated.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_git_fetch.rs undo: options to preserve git refs and/or remote-tracking branches on undo or restore 2023-07-03 12:28:06 -07:00
test_git_import_export.rs cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib 2023-07-09 06:40:43 +02:00
test_git_push.rs cli: warn if loosely selected push targets include conflicted branches 2023-07-08 10:23:21 +09:00
test_git_remotes.rs
test_git_submodule.rs git: add a hidden submodule subcommand 2023-06-27 10:07:00 -07:00
test_gitignores.rs
test_global_opts.rs cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib 2023-07-09 06:40:43 +02:00
test_init_command.rs backend: introduce error types specific to init/load phases 2023-07-06 20:48:46 +09:00
test_interdiff_command.rs
test_log_command.rs tests: add helper method to capture both stdout/stderr outputs 2023-07-03 22:03:05 +09:00
test_move_command.rs
test_new_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_obslog_command.rs
test_operations.rs
test_rebase_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_resolve_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_restore_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_revset_output.rs tests: add helper method to capture both stdout/stderr outputs 2023-07-03 22:03:05 +09:00
test_show_command.rs
test_sparse_command.rs add --edit option to jj sparse set 2023-06-27 22:56:46 +09:00
test_split_command.rs tests: add helper method to capture both stdout/stderr outputs 2023-07-03 22:03:05 +09:00
test_squash_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_status_command.rs
test_templater.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_undo.rs undo: preserve git-tracking refs in colocated repos by default 2023-07-03 12:28:06 -07:00
test_unsquash_command.rs revset_graph: group commits topologically 2023-07-25 01:45:37 +09:00
test_untrack_command.rs
test_util_command.rs
test_workspaces.rs