Skip to content

Commit

Permalink
Rename PatchSeries -> Branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsgrd committed Nov 8, 2024
1 parent 0bd3f6d commit 2d7b996
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/branch/SeriesHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import { openExternalUrl } from '$lib/utils/url';
import { BranchController } from '$lib/vbranches/branchController';
import { listCommitFiles } from '$lib/vbranches/remoteCommits';
import { PatchSeries, BranchStack, type CommitStatus } from '$lib/vbranches/types';
import { Branch, BranchStack, type CommitStatus } from '$lib/vbranches/types';
import { CloudBranchesService } from '@gitbutler/shared/cloud/stacks/service';
import { getContext, getContextStore } from '@gitbutler/shared/context';
import Button from '@gitbutler/ui/Button.svelte';
Expand All @@ -33,7 +33,7 @@
import { tick } from 'svelte';
interface Props {
currentSeries: PatchSeries;
currentSeries: Branch;
isTopSeries: boolean;
}
Expand Down
14 changes: 7 additions & 7 deletions apps/desktop/src/lib/dragging/stackingReorderDropzoneManager.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { DraggableCommit } from '$lib/dragging/draggables';
import type { BranchController } from '$lib/vbranches/branchController';
import type { BranchStack, PatchSeries, StackOrder } from '$lib/vbranches/types';
import type { BranchStack, Branch, StackOrder } from '$lib/vbranches/types';

export class StackingReorderDropzone {
constructor(
private branchId: string,
private branchController: BranchController,
private currentSeries: PatchSeries,
private series: PatchSeries[],
private currentSeries: Branch,
private series: Branch[],
public commitId: string
) {}

Expand Down Expand Up @@ -44,7 +44,7 @@ export class StackingReorderDropzone {
}

export class StackingReorderDropzoneManager {
public series: Map<string, PatchSeries>;
public series: Map<string, Branch>;

constructor(
private branchController: BranchController,
Expand Down Expand Up @@ -97,8 +97,8 @@ export class StackingReorderDropzoneManagerFactory {
}

export function buildNewStackOrder(
allSeries: PatchSeries[],
currentSeries: PatchSeries,
allSeries: Branch[],
currentSeries: Branch,
actorCommitId: string,
targetCommitId: string
): StackOrder | undefined {
Expand Down Expand Up @@ -143,7 +143,7 @@ export function buildNewStackOrder(
}

function distanceBetweenDropzones(
allSeries: PatchSeries[],
allSeries: Branch[],
actorDropzoneId: string,
targetDropzoneId: string
) {
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/pr/PrDetailsModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { error } from '$lib/utils/toasts';
import { openExternalUrl } from '$lib/utils/url';
import { BranchController } from '$lib/vbranches/branchController';
import { PatchSeries, BranchStack } from '$lib/vbranches/types';
import { Branch, BranchStack } from '$lib/vbranches/types';
import { getContext, getContextStore } from '@gitbutler/shared/context';
import { persisted } from '@gitbutler/shared/persisted';
import Button from '@gitbutler/ui/Button.svelte';
Expand All @@ -58,7 +58,7 @@
interface PreviewSeriesProps {
type: 'preview-series';
currentSeries: PatchSeries;
currentSeries: Branch;
stackId: string;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/stack/CurrentSeries.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import { getForgeListingService } from '$lib/forge/interface/forgeListingService';
import { createForgePrMonitorStore } from '$lib/forge/interface/forgePrMonitor';
import { getForgePrService } from '$lib/forge/interface/forgePrService';
import type { PatchSeries } from '$lib/vbranches/types';
import type { Branch } from '$lib/vbranches/types';
import type { Snippet } from 'svelte';
interface Props {
currentSeries: PatchSeries;
currentSeries: Branch;
children: Snippet;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/stack/SeriesDividerLine.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { getColorFromBranchType } from '$lib/branch/stackingUtils';
import type { CommitStatus, PatchSeries } from '$lib/vbranches/types';
import type { CommitStatus, Branch } from '$lib/vbranches/types';
interface Props {
currentSeries: PatchSeries;
currentSeries: Branch;
}
const { currentSeries }: Props = $props();
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/stack/SeriesList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import CardOverlay from '$lib/dropzone/CardOverlay.svelte';
import Dropzone from '$lib/dropzone/Dropzone.svelte';
import { BranchController } from '$lib/vbranches/branchController';
import { PatchSeries, type BranchStack } from '$lib/vbranches/types';
import { Branch, type BranchStack } from '$lib/vbranches/types';
import { getContext } from '@gitbutler/shared/context';
import EmptyStatePlaceholder from '@gitbutler/ui/EmptyStatePlaceholder.svelte';
Expand Down Expand Up @@ -40,7 +40,7 @@
return true;
}
function onDrop(data: DraggableCommit, allSeries: PatchSeries[], currentSeries: PatchSeries) {
function onDrop(data: DraggableCommit, allSeries: Branch[], currentSeries: Branch) {
if (!(data instanceof DraggableCommit)) return;
const stackOrder = buildNewStackOrder(allSeries, currentSeries, data.commit.id, 'top');
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/stack/header/HeaderMetaSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import SeriesRowLabels from './SeriesLabels.svelte';
import BranchLaneContextMenu from '$lib/branch/BranchLaneContextMenu.svelte';
import ContextMenu from '$lib/components/contextmenu/ContextMenu.svelte';
import { PatchSeries } from '$lib/vbranches/types';
import { Branch } from '$lib/vbranches/types';
import Button from '@gitbutler/ui/Button.svelte';
interface Props {
series: PatchSeries[];
series: Branch[];
onCollapseButtonClick: () => void;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/lib/stack/header/SeriesLabels.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import Select from '$lib/select/Select.svelte';
import { PatchSeries } from '$lib/vbranches/types';
import { Branch } from '$lib/vbranches/types';
import Icon from '@gitbutler/ui/Icon.svelte';
import SeriesLabelsRow from '@gitbutler/ui/SeriesLabelsRow.svelte';
interface Props {
series: PatchSeries[];
series: Branch[];
disableSelector?: boolean;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop/src/lib/vbranches/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export class BranchStack {
tree!: string;

// Used in the stacking context where VirtualBranch === Stack
@Type(() => PatchSeries)
series!: PatchSeries[];
@Type(() => Branch)
series!: Branch[];

get localCommits() {
return this.commits.filter((c) => c.status === 'local');
Expand Down Expand Up @@ -424,7 +424,7 @@ export interface BranchPushResult {
remote: string;
}

export class PatchSeries {
export class Branch {
name!: string;
description?: string;
upstreamReference?: string;
Expand Down
8 changes: 4 additions & 4 deletions crates/gitbutler-branch-actions/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
use crate::{
actions::open_with_verify,
commit::{commit_to_vbranch_commit, VirtualBranchCommit},
r#virtual::{CommitData, IsCommitIntegrated, PatchSeries},
r#virtual::{Branch, CommitData, IsCommitIntegrated},
VirtualBranchesExt,
};
use gitbutler_operating_modes::assure_open_workspace_mode;
Expand Down Expand Up @@ -239,9 +239,9 @@ pub(crate) fn stack_series(
check_commit: &mut IsCommitIntegrated,
remote_commit_data: HashMap<CommitData, git2::Oid>,
commits: &[VirtualBranchCommit],
) -> Result<(Vec<PatchSeries>, bool)> {
) -> Result<(Vec<Branch>, bool)> {
let mut requires_force = false;
let mut api_series: Vec<PatchSeries> = vec![];
let mut api_series: Vec<Branch> = vec![];
let stack_series = branch.list_series(ctx)?;
for series in stack_series.clone() {
let remote = default_target.push_remote_name();
Expand Down Expand Up @@ -314,7 +314,7 @@ pub(crate) fn stack_series(
if !upstream_patches.is_empty() {
requires_force = true;
}
api_series.push(PatchSeries {
api_series.push(Branch {
name: series.head.name,
description: series.head.description,
upstream_reference,
Expand Down
4 changes: 2 additions & 2 deletions crates/gitbutler-branch-actions/src/virtual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct BranchStack {
pub tree: git2::Oid,
/// New way to group commits into a multiple patch series
/// Most recent entries are first in order
pub series: Vec<PatchSeries>,
pub series: Vec<Branch>,
}

/// A grouping that combines multiple commits into a patch series
Expand All @@ -88,7 +88,7 @@ pub struct BranchStack {
/// independent branches to representing independent stacks of dependent patch series (branches).
#[derive(Debug, PartialEq, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PatchSeries {
pub struct Branch {
pub name: String,
pub description: Option<String>,
pub upstream_reference: Option<String>,
Expand Down

0 comments on commit 2d7b996

Please sign in to comment.