chore: remove user-facing config for using diff contexts infavor of automatic migration

This commit is contained in:
Kiril Videlov 2024-02-25 21:37:51 +01:00 committed by Kiril Videlov
parent 08d22de40e
commit 000ddeff91
4 changed files with 191 additions and 146 deletions

View File

@ -2412,7 +2412,7 @@ fn test_verify_branch_commits_to_integration() -> Result<()> {
integration::verify_branch(&gb_repository, &project_repository).unwrap(); integration::verify_branch(&gb_repository, &project_repository).unwrap();
// one virtual branch with two commits was created // one virtual branch with two commits was created
let virtual_(branches, _) = list_virtual_branches(&gb_repository, &project_repository)?; let (virtual_branches, _) = list_virtual_branches(&gb_repository, &project_repository)?;
assert_eq!(virtual_branches.len(), 1); assert_eq!(virtual_branches.len(), 1);
let branch = &virtual_branches.first().unwrap(); let branch = &virtual_branches.first().unwrap();

File diff suppressed because it is too large Load Diff

View File

@ -8,14 +8,12 @@
let allowForcePushing = project?.ok_with_force_push; let allowForcePushing = project?.ok_with_force_push;
let omitCertificateCheck = project?.omit_certificate_check; let omitCertificateCheck = project?.omit_certificate_check;
let useDiffContext = project?.use_diff_context;
const runCommitHooks = projectRunCommitHooks(project.id); const runCommitHooks = projectRunCommitHooks(project.id);
const dispatch = createEventDispatcher<{ const dispatch = createEventDispatcher<{
updated: { updated: {
ok_with_force_push?: boolean; ok_with_force_push?: boolean;
omit_certificate_check?: boolean; omit_certificate_check?: boolean;
use_diff_context?: boolean;
}; };
}>(); }>();
</script> </script>
@ -71,25 +69,4 @@
<p class="ml-7 text-light-700 dark:text-dark-200"> <p class="ml-7 text-light-700 dark:text-dark-200">
Enabling this will run any git pre and post commit hooks you have configured in your repository. Enabling this will run any git pre and post commit hooks you have configured in your repository.
</p> </p>
<form class="flex items-center gap-1">
<Checkbox
name="use-diff-context"
checked={useDiffContext}
disabled={useDiffContext}
on:change={() => {
useDiffContext = !useDiffContext;
dispatch('updated', { use_diff_context: useDiffContext });
}}
/>
<label class="ml-2" for="allow-force-pushing">
<div>
Use diffs with context lines internally (for migration purposes, can only be enabled)
</div>
</label>
</form>
<p class="ml-7 text-light-700 dark:text-dark-200">
Only toggle this with an empty workspace. If enabled, the application will use diffs with
context lines internally.
</p>
</div> </div>

View File

@ -48,11 +48,7 @@
const onCloudUpdated = (e: { detail: Project }) => const onCloudUpdated = (e: { detail: Project }) =>
projectService.updateProject({ ...$project$, ...e.detail }); projectService.updateProject({ ...$project$, ...e.detail });
const onPreferencesUpdated = (e: { const onPreferencesUpdated = (e: {
detail: { detail: { ok_with_force_push?: boolean; omit_certificate_check?: boolean };
ok_with_force_push?: boolean;
omit_certificate_check?: boolean;
use_diff_context?: boolean;
};
}) => projectService.updateProject({ ...$project$, ...e.detail }); }) => projectService.updateProject({ ...$project$, ...e.detail });
const onDetailsUpdated = async (e: { detail: Project }) => { const onDetailsUpdated = async (e: { detail: Project }) => {
const api = const api =