forked from mirrors/jj
a6ef3f0b6c
This adds a new `revset-aliases.immutable_heads()s` config for defining the set of immutable commits. The set is defined as the configured revset, as well as its ancestors, and the root commit commit (even if the configured set is empty). This patch also adds enforcement of the config where we already had checks preventing rewrite of the root commit. The working-copy commit is implicitly assumed to be writable in most cases. Specifically, we won't prevent amending the working copy even if the user includes it in the config but we do prevent `jj edit @` in that case. That seems good enough to me. Maybe we should emit a warning when the working copy is in the set of immutable commits. Maybe we should add support for something more like [Mercurial's phases](https://wiki.mercurial-scm.org/Phases), which is propagated on push and pull. There's already some affordance for that in the view object's `public_heads` field. However, this is simpler, especially since we can't propagate the phase to Git remotes, and seems like a good start. Also, it lets you say that commits authored by other users are immutable, for example. For now, the functionality is in the CLI library. I'm not sure if we want to move it into the library crate. I'm leaning towards letting library users do whatever they want without being restricted by immutable commits. I do think we should move the functionality into a future `ui-lib` or `ui-util` crate. That crate would have most of the functionality in the current `cli_util` module (but in a non-CLI-specific form). |
||
---|---|---|
.. | ||
common | ||
test_abandon_command.rs | ||
test_alias.rs | ||
test_branch_command.rs | ||
test_builtin_aliases.rs | ||
test_cat_command.rs | ||
test_checkout.rs | ||
test_chmod_command.rs | ||
test_commit_command.rs | ||
test_commit_template.rs | ||
test_concurrent_operations.rs | ||
test_config_command.rs | ||
test_debug_command.rs | ||
test_describe_command.rs | ||
test_diff_command.rs | ||
test_diffedit_command.rs | ||
test_duplicate_command.rs | ||
test_edit_command.rs | ||
test_git_clone.rs | ||
test_git_colocated.rs | ||
test_git_fetch.rs | ||
test_git_import_export.rs | ||
test_git_push.rs | ||
test_git_remotes.rs | ||
test_git_submodule.rs | ||
test_gitignores.rs | ||
test_global_opts.rs | ||
test_immutable_commits.rs | ||
test_init_command.rs | ||
test_interdiff_command.rs | ||
test_log_command.rs | ||
test_move_command.rs | ||
test_new_command.rs | ||
test_next_prev_commands.rs | ||
test_obslog_command.rs | ||
test_operations.rs | ||
test_rebase_command.rs | ||
test_resolve_command.rs | ||
test_restore_command.rs | ||
test_revset_output.rs | ||
test_show_command.rs | ||
test_sparse_command.rs | ||
test_split_command.rs | ||
test_squash_command.rs | ||
test_status_command.rs | ||
test_templater.rs | ||
test_tree_level_conflicts.rs | ||
test_undo.rs | ||
test_unsquash_command.rs | ||
test_untrack_command.rs | ||
test_util_command.rs | ||
test_working_copy.rs | ||
test_workspaces.rs |