Browse Source

Removes dead code

main
Eric Amodio 1 year ago
parent
commit
74c6db4942
2 changed files with 0 additions and 141 deletions
  1. +0
    -85
      src/commands/patches.ts
  2. +0
    -56
      src/plus/webviews/patchDetails/protocol.ts

+ 0
- 85
src/commands/patches.ts View File

@ -118,92 +118,7 @@ export class CreateCloudPatchCommand extends Command {
return showPatchesView({ mode: 'create', create: { repositories: [repo] } }); return showPatchesView({ mode: 'create', create: { repositories: [repo] } });
} }
return showPatchesView({ mode: 'create', create: create }); return showPatchesView({ mode: 'create', create: create });
// let changes: Change[] | undefined;
// if (args?.repoPath != null) {
// const repo = this.container.git.getRepository(args.repoPath);
// if (repo == null) return;
// const diff = await this.container.git.getDiff(repo.uri, args.ref1 ?? 'HEAD', args.ref2);
// if (diff == null) return;
// const result = await this.container.git.getDiffFiles(args.repoPath, diff.contents);
// if (result?.files == null) return;
// const branch = await repo.getBranch();
// changes = [
// {
// type: 'commit',
// repository: {
// name: repo.name,
// path: repo.path,
// uri: repo.uri.toString(true),
// },
// files: result.files,
// range: {
// baseSha: args.ref2 ?? `${args.ref1 ?? 'HEAD'}^`,
// branchName: branch?.name ?? 'HEAD',
// sha: args.ref1 ?? 'HEAD',
// },
// },
// ];
// }
// let repo;
// if (args?.repoPath == null) {
// repo = await getRepositoryOrShowPicker('Create Cloud Patch');
// } else {
// repo = this.container.git.getRepository(args.repoPath);
// }
// if (repo == null) return;
// const diff = await this.container.git.getDiff(repo.uri, args?.ref1 ?? 'HEAD', args?.ref2);
// if (diff == null) return;
// const d = await workspace.openTextDocument({ content: diff.contents, language: 'diff' });
// await window.showTextDocument(d);
// // ask the user for a title
// const title = await window.showInputBox({
// title: 'Create Cloud Patch',
// prompt: 'Enter a title for the patch',
// validateInput: value => (value == null || value.length === 0 ? 'A title is required' : undefined),
// });
// if (title == null) return;
// // ask the user for an optional description
// const description = await window.showInputBox({
// title: 'Create Cloud Patch',
// prompt: 'Enter an optional description for the patch',
// });
// const patch = await this.container.drafts.createDraft(
// 'patch',
// title,
// {
// contents: diff.contents,
// baseSha: diff.baseSha,
// repository: repo,
// },
// { description: description },
// );
// void this.showPatchNotification(patch);
} }
// private async showPatchNotification(patch: Draft | undefined) {
// if (patch == null) return;
// await env.clipboard.writeText(patch.deepLinkUrl);
// const copy = { title: 'Copy Link' };
// const result = await window.showInformationMessage(`Created cloud patch ${patch.id}`, copy);
// if (result === copy) {
// await env.clipboard.writeText(patch.deepLinkUrl);
// }
// }
} }
@command() @command()

+ 0
- 56
src/plus/webviews/patchDetails/protocol.ts View File

@ -49,15 +49,6 @@ interface LocalDraftDetails {
description?: string; description?: string;
patches?: PatchDetails[]; patches?: PatchDetails[];
// files?: GitFileChangeShape[];
// stats?: GitCommitStats;
// repoPath?: string;
// repoName?: string;
// baseRef?: string;
// commit?: string;
} }
interface CloudDraftDetails { interface CloudDraftDetails {
@ -77,33 +68,10 @@ interface CloudDraftDetails {
description?: string; description?: string;
patches?: PatchDetails[]; patches?: PatchDetails[];
// commit?: string;
// files?: GitFileChangeShape[];
// stats?: GitCommitStats;
// repoPath: string;
// repoName?: string;
// baseRef?: string;
} }
export type DraftDetails = LocalDraftDetails | CloudDraftDetails; export type DraftDetails = LocalDraftDetails | CloudDraftDetails;
// export interface RangeRef {
// baseSha: string;
// sha: string | undefined;
// branchName: string;
// // shortSha: string;
// // summary: string;
// // message: string;
// // author: GitCommitIdentityShape & { avatar: string | undefined };
// // committer: GitCommitIdentityShape & { avatar: string | undefined };
// // parents: string[];
// // repoPath: string;
// // stashNumber?: string;
// }
export interface Preferences { export interface Preferences {
avatars: boolean; avatars: boolean;
dateFormat: DateTimeFormat | string; dateFormat: DateTimeFormat | string;
@ -139,30 +107,6 @@ export interface RevisionChange {
export type Change = WipChange | RevisionChange; export type Change = WipChange | RevisionChange;
// export interface RepoCommitChange {
// type: 'commit';
// repoName: string;
// repoUri: string;
// change: Change;
// checked: boolean;
// expanded: boolean;
// }
// export interface RepoWipChange {
// type: 'wip';
// repoName: string;
// repoUri: string;
// change: Change | undefined;
// checked: boolean | 'staged';
// expanded: boolean;
// }
// export type RepoChangeSet = RepoCommitChange | RepoWipChange;
export interface State { export interface State {
webviewId: WebviewIds | WebviewViewIds; webviewId: WebviewIds | WebviewViewIds;
timestamp: number; timestamp: number;

Loading…
Cancel
Save