Przeglądaj źródła

Renames files for better clarity

main
Eric Amodio 6 lat temu
rodzic
commit
35b437afbf
53 zmienionych plików z 2110 dodań i 2103 usunięć
  1. +1
    -1
      src/commands/diffBranchWithBranch.ts
  2. +1
    -1
      src/commands/diffDirectory.ts
  3. +1
    -1
      src/commands/diffWithBranch.ts
  4. +1
    -1
      src/commands/diffWithRevision.ts
  5. +1
    -1
      src/commands/openBranchInRemote.ts
  6. +1
    -1
      src/commands/openFileRevision.ts
  7. +1
    -1
      src/commands/openInRemote.ts
  8. +1
    -1
      src/commands/showCommitSearch.ts
  9. +1
    -1
      src/commands/showQuickBranchHistory.ts
  10. +2
    -2
      src/commands/showQuickCommitDetails.ts
  11. +2
    -2
      src/commands/showQuickCommitFileDetails.ts
  12. +1
    -1
      src/commands/showQuickCurrentBranchHistory.ts
  13. +1
    -1
      src/commands/showQuickFileHistory.ts
  14. +1
    -1
      src/commands/showQuickRepoStatus.ts
  15. +1
    -1
      src/commands/showQuickStashList.ts
  16. +1
    -1
      src/commands/stashApply.ts
  17. +1
    -1
      src/commands/stashDelete.ts
  18. +1
    -1
      src/commands/stashSave.ts
  19. +0
    -0
      src/git/formatters/commitFormatter.ts
  20. +4
    -0
      src/git/formatters/formatters.ts
  21. +0
    -0
      src/git/formatters/statusFormatter.ts
  22. +1
    -8
      src/git/git.ts
  23. +2
    -1
      src/git/models/models.ts
  24. +10
    -0
      src/git/parsers/parsers.ts
  25. +1
    -2
      src/gitService.ts
  26. +0
    -14
      src/quickPicks.ts
  27. +2
    -2
      src/quickPicks/branchHistoryQuickPick.ts
  28. +1
    -1
      src/quickPicks/branchesAndTagsQuickPick.ts
  29. +1
    -1
      src/quickPicks/branchesQuickPick.ts
  30. +3
    -3
      src/quickPicks/commitFileQuickPick.ts
  31. +3
    -3
      src/quickPicks/commitQuickPick.ts
  32. +1
    -1
      src/quickPicks/commitsQuickPick.ts
  33. +1
    -1
      src/quickPicks/commonQuickPicks.ts
  34. +2
    -2
      src/quickPicks/fileHistoryQuickPick.ts
  35. +14
    -0
      src/quickPicks/quickPicks.ts
  36. +1
    -1
      src/quickPicks/remotesQuickPick.ts
  37. +326
    -326
      src/quickPicks/repoStatusQuickPick.ts
  38. +1
    -1
      src/quickPicks/repositoriesQuickPick.ts
  39. +1
    -1
      src/quickPicks/stashListQuickPick.ts

+ 1
- 1
src/commands/diffBranchWithBranch.ts Wyświetl plik

@ -5,7 +5,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks';
export interface DiffBranchWithBranchCommandArgs {
ref1?: string;

+ 1
- 1
src/commands/diffDirectory.ts Wyświetl plik

@ -7,7 +7,7 @@ import { Container } from '../container';
import { ComparisonResultsNode } from '../views/explorerNodes';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks';
export interface DiffDirectoryCommandArgs {
ref1?: string;

+ 1
- 1
src/commands/diffWithBranch.ts Wyświetl plik

@ -7,7 +7,7 @@ import { Container } from '../container';
import { DiffWithCommandArgs } from './diffWith';
import { GitUri } from '../gitService';
import { Messages } from '../messages';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks';
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks';
import * as path from 'path';
export interface DiffWithBranchCommandArgs {

+ 1
- 1
src/commands/diffWithRevision.ts Wyświetl plik

@ -8,7 +8,7 @@ import { DiffWithCommandArgs } from './diffWith';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks/quickPicks';
export interface DiffWithRevisionCommandArgs {
maxCount?: number;

+ 1
- 1
src/commands/openBranchInRemote.ts Wyświetl plik

@ -5,7 +5,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks';
import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks';
import { OpenInRemoteCommandArgs } from './openInRemote';
export interface OpenBranchInRemoteCommandArgs {

+ 1
- 1
src/commands/openFileRevision.ts Wyświetl plik

@ -8,7 +8,7 @@ import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks/quickPicks';
export interface OpenFileRevisionCommandArgs {
uri?: Uri;

+ 1
- 1
src/commands/openInRemote.ts Wyświetl plik

@ -5,7 +5,7 @@ import { ActiveEditorCommand, Commands } from './common';
import { GlyphChars } from '../constants';
import { GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks';
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks/quickPicks';
export interface OpenInRemoteCommandArgs {
remote?: string;

+ 1
- 1
src/commands/showCommitSearch.ts Wyświetl plik

@ -6,7 +6,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitRepoSearchBy, GitService, GitUri } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, CommitsQuickPick, RepositoriesQuickPick, ShowCommitsSearchInResultsQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, CommitsQuickPick, RepositoriesQuickPick, ShowCommitsSearchInResultsQuickPickItem } from '../quickPicks/quickPicks';
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
const searchByRegex = /^([@~=:#])/;

+ 1
- 1
src/commands/showQuickBranchHistory.ts Wyświetl plik

@ -7,7 +7,7 @@ import { Container } from '../container';
import { GitLog, GitUri } from '../gitService';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { BranchesQuickPick, BranchHistoryQuickPick, CommandQuickPickItem } from '../quickPicks';
import { BranchesQuickPick, BranchHistoryQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks';
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
export interface ShowQuickBranchHistoryCommandArgs {

+ 2
- 2
src/commands/showQuickCommitDetails.ts Wyświetl plik

@ -5,7 +5,7 @@ import { ActiveEditorCachedCommand, CommandContext, Commands, getCommandUri, isC
import { GlyphChars } from '../constants';
import { GitCommit, GitLog, GitLogCommit, GitUri } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, CommitDetailsQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, CommitQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks/quickPicks';
import { ShowQuickCommitFileDetailsCommandArgs } from './showQuickCommitFileDetails';
import { Messages } from '../messages';
import * as path from 'path';
@ -124,7 +124,7 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCachedCommand {
args
]);
const pick = await CommitDetailsQuickPick.show(args.commit as GitLogCommit, uri, args.goBackCommand, currentCommand, args.repoLog);
const pick = await CommitQuickPick.show(args.commit as GitLogCommit, uri, args.goBackCommand, currentCommand, args.repoLog);
if (pick === undefined) return undefined;
if (!(pick instanceof CommitWithFileStatusQuickPickItem)) return pick.execute();

+ 2
- 2
src/commands/showQuickCommitFileDetails.ts Wyświetl plik

@ -5,7 +5,7 @@ import { ActiveEditorCachedCommand, CommandContext, Commands, getCommandUri, isC
import { GlyphChars } from '../constants';
import { GitCommit, GitLog, GitLogCommit, GitService, GitUri } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, CommitFileDetailsQuickPick } from '../quickPicks';
import { CommandQuickPickItem, CommitFileQuickPick } from '../quickPicks/quickPicks';
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
import { Messages } from '../messages';
import * as path from 'path';
@ -130,7 +130,7 @@ export class ShowQuickCommitFileDetailsCommand extends ActiveEditorCachedCommand
args
]);
const pick = await CommitFileDetailsQuickPick.show(args.commit as GitLogCommit, uri, args.goBackCommand, currentCommand, args.fileLog);
const pick = await CommitFileQuickPick.show(args.commit as GitLogCommit, uri, args.goBackCommand, currentCommand, args.fileLog);
if (pick === undefined) return undefined;
if (pick instanceof CommandQuickPickItem) return pick.execute();

+ 1
- 1
src/commands/showQuickCurrentBranchHistory.ts Wyświetl plik

@ -4,7 +4,7 @@ import { ActiveEditorCachedCommand, Commands, getCommandUri } from './common';
import { Container } from '../container';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem } from '../quickPicks/quickPicks';
import { ShowQuickBranchHistoryCommandArgs } from './showQuickBranchHistory';
export interface ShowQuickCurrentBranchHistoryCommandArgs {

+ 1
- 1
src/commands/showQuickFileHistory.ts Wyświetl plik

@ -6,7 +6,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitLog, GitUri } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowCommitsInResultsQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem, FileHistoryQuickPick, ShowCommitsInResultsQuickPickItem } from '../quickPicks/quickPicks';
import { ShowQuickCommitFileDetailsCommandArgs } from './showQuickCommitFileDetails';
import { Messages } from '../messages';
import * as path from 'path';

+ 1
- 1
src/commands/showQuickRepoStatus.ts Wyświetl plik

@ -4,7 +4,7 @@ import { ActiveEditorCachedCommand, Commands, getCommandUri } from './common';
import { Container } from '../container';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks';
import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks/quickPicks';
export interface ShowQuickRepoStatusCommandArgs {
goBackCommand?: CommandQuickPickItem;

+ 1
- 1
src/commands/showQuickStashList.ts Wyświetl plik

@ -6,7 +6,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem, StashListQuickPick } from '../quickPicks';
import { CommandQuickPickItem, StashListQuickPick } from '../quickPicks/quickPicks';
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
export interface ShowQuickStashListCommandArgs {

+ 1
- 1
src/commands/stashApply.ts Wyświetl plik

@ -6,7 +6,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitStashCommit } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem, RepositoriesQuickPick, StashListQuickPick } from '../quickPicks';
import { CommandQuickPickItem, RepositoriesQuickPick, StashListQuickPick } from '../quickPicks/quickPicks';
export interface StashApplyCommandArgs {
confirm?: boolean;

+ 1
- 1
src/commands/stashDelete.ts Wyświetl plik

@ -5,7 +5,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitStashCommit } from '../gitService';
import { Logger } from '../logger';
import { CommandQuickPickItem } from '../quickPicks';
import { CommandQuickPickItem } from '../quickPicks/quickPicks';
export interface StashDeleteCommandArgs {
confirm?: boolean;

+ 1
- 1
src/commands/stashSave.ts Wyświetl plik

@ -5,7 +5,7 @@ import { Command, Commands } from './common';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { Logger } from '../logger';
import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickPicks';
import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickPicks/quickPicks';
export interface StashSaveCommandArgs {
message?: string;

src/git/formatters/commit.ts → src/git/formatters/commitFormatter.ts Wyświetl plik


+ 4
- 0
src/git/formatters/formatters.ts Wyświetl plik

@ -0,0 +1,4 @@
'use strict';
export * from './commitFormatter';
export * from './statusFormatter';

src/git/formatters/status.ts → src/git/formatters/statusFormatter.ts Wyświetl plik


+ 1
- 8
src/git/git.ts Wyświetl plik

@ -9,14 +9,7 @@ import * as path from 'path';
export { IGit };
export * from './models/models';
export * from './parsers/blameParser';
export * from './parsers/branchParser';
export * from './parsers/diffParser';
export * from './parsers/logParser';
export * from './parsers/remoteParser';
export * from './parsers/stashParser';
export * from './parsers/statusParser';
export * from './parsers/tagParser';
export * from './parsers/parsers';
export * from './remotes/provider';
let git: IGit;

+ 2
- 1
src/git/models/models.ts Wyświetl plik

@ -1,4 +1,5 @@
'use strict';
export * from './blame';
export * from './blameCommit';
export * from './branch';
@ -11,4 +12,4 @@ export * from './repository';
export * from './stash';
export * from './stashCommit';
export * from './status';
export * from './tag';
export * from './tag';

+ 10
- 0
src/git/parsers/parsers.ts Wyświetl plik

@ -0,0 +1,10 @@
'use strict';
export * from './blameParser';
export * from './branchParser';
export * from './diffParser';
export * from './logParser';
export * from './remoteParser';
export * from './stashParser';
export * from './statusParser';
export * from './tagParser';

+ 1
- 2
src/gitService.ts Wyświetl plik

@ -14,8 +14,7 @@ import * as path from 'path';
export { GitUri, IGit, IGitCommitInfo };
export * from './git/models/models';
export * from './git/formatters/commit';
export * from './git/formatters/status';
export * from './git/formatters/formatters';
export { getNameFromRemoteResource, RemoteProvider, RemoteResource, RemoteResourceType } from './git/remotes/provider';
export { RemoteProviderFactory } from './git/remotes/factory';

+ 0
- 14
src/quickPicks.ts Wyświetl plik

@ -1,14 +0,0 @@
'use strict';
export * from './quickPicks/common';
export * from './quickPicks/branches';
export * from './quickPicks/branchesAndTags';
export * from './quickPicks/commitDetails';
export * from './quickPicks/commitFileDetails';
export * from './quickPicks/commits';
export * from './quickPicks/branchHistory';
export * from './quickPicks/fileHistory';
export * from './quickPicks/remotes';
export * from './quickPicks/repositories';
export * from './quickPicks/repoStatus';
export * from './quickPicks/stashList';

src/quickPicks/branchHistory.ts → src/quickPicks/branchHistoryQuickPick.ts Wyświetl plik

@ -2,12 +2,12 @@
import { Iterables, Strings } from '../system';
import { CancellationTokenSource, QuickPickOptions, window } from 'vscode';
import { Commands, ShowCommitSearchCommandArgs, ShowQuickBranchHistoryCommandArgs } from '../commands';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './common';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitLog, GitUri, RemoteResource } from '../gitService';
import { KeyNoopCommand } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick';
export class BranchHistoryQuickPick {

src/quickPicks/branchesAndTags.ts → src/quickPicks/branchesAndTagsQuickPick.ts Wyświetl plik

@ -1,6 +1,6 @@
'use strict';
import { CancellationTokenSource, QuickPickItem, QuickPickOptions, window } from 'vscode';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './common';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitBranch, GitTag } from '../gitService';

src/quickPicks/branches.ts → src/quickPicks/branchesQuickPick.ts Wyświetl plik

@ -1,6 +1,6 @@
'use strict';
import { QuickPickItem, QuickPickOptions, window } from 'vscode';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './common';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { GitBranch } from '../gitService';

src/quickPicks/commitFileDetails.ts → src/quickPicks/commitFileQuickPick.ts Wyświetl plik

@ -2,12 +2,12 @@
import { Iterables, Strings } from '../system';
import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, openEditor, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './common';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitLog, GitLogCommit, GitUri, RemoteResource } from '../gitService';
import { KeyCommand, KeyNoopCommand } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick';
import * as path from 'path';
export class ApplyCommitFileChangesCommandQuickPickItem extends CommandQuickPickItem {
@ -65,7 +65,7 @@ export class OpenCommitFileRevisionCommandQuickPickItem extends OpenFileCommandQ
}
}
export class CommitFileDetailsQuickPick {
export class CommitFileQuickPick {
static async show(commit: GitLogCommit, uri: Uri, goBackCommand?: CommandQuickPickItem, currentCommand?: CommandQuickPickItem, fileLog?: GitLog): Promise<CommandQuickPickItem | undefined> {
const items: CommandQuickPickItem[] = [];

src/quickPicks/commitDetails.ts → src/quickPicks/commitQuickPick.ts Wyświetl plik

@ -2,12 +2,12 @@
import { Arrays, Iterables, Strings } from '../system';
import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from 'vscode';
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffDirectoryCommandArgs, DiffWithPreviousCommandArgs, ShowQuickCommitDetailsCommandArgs, StashApplyCommandArgs, StashDeleteCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem, QuickPickItem, ShowCommitInResultsQuickPickItem } from './common';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem, QuickPickItem, ShowCommitInResultsQuickPickItem } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { getGitStatusOcticon, GitLog, GitLogCommit, GitStashCommit, GitStatusFile, GitStatusFileStatus, GitUri, IGitStatusFile, RemoteResource } from '../gitService';
import { KeyCommand, KeyNoopCommand, Keys } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick';
import * as path from 'path';
export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickItem {
@ -87,7 +87,7 @@ export class OpenCommitFileRevisionsCommandQuickPickItem extends OpenFilesComman
}
}
export class CommitDetailsQuickPick {
export class CommitQuickPick {
static async show(commit: GitLogCommit, uri: Uri, goBackCommand?: CommandQuickPickItem, currentCommand?: CommandQuickPickItem, repoLog?: GitLog): Promise<CommitWithFileStatusQuickPickItem | CommandQuickPickItem | undefined> {
await commit.resolvePreviousFileSha();

src/quickPicks/commits.ts → src/quickPicks/commitsQuickPick.ts Wyświetl plik

@ -4,7 +4,7 @@ import { CancellationTokenSource, QuickPickOptions, window } from 'vscode';
import { Container } from '../container';
import { GitLog } from '../gitService';
import { KeyNoopCommand } from '../keyboard';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, MessageQuickPickItem, showQuickPickProgress } from '../quickPicks';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, MessageQuickPickItem, showQuickPickProgress } from '../quickPicks/quickPicks';
export class CommitsQuickPick {

src/quickPicks/common.ts → src/quickPicks/commonQuickPicks.ts Wyświetl plik

@ -1,7 +1,7 @@
'use strict';
import { Strings } from '../system';
import { CancellationTokenSource, commands, QuickPickItem, QuickPickOptions, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
import { BranchesAndTagsQuickPick, BranchOrTagQuickPickItem } from './branchesAndTags';
import { BranchesAndTagsQuickPick, BranchOrTagQuickPickItem } from './branchesAndTagsQuickPick';
import { Commands, openEditor } from '../commands';
import { configuration } from '../configuration';
import { GlyphChars } from '../constants';

src/quickPicks/fileHistory.ts → src/quickPicks/fileHistoryQuickPick.ts Wyświetl plik

@ -2,12 +2,12 @@
import { Iterables, Strings } from '../system';
import { CancellationTokenSource, QuickPickOptions, Uri, window } from 'vscode';
import { Commands, ShowQuickCurrentBranchHistoryCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, ShowBranchesAndTagsQuickPickItem, showQuickPickProgress } from './common';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, ShowBranchesAndTagsQuickPickItem, showQuickPickProgress } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitLog, GitUri, RemoteResource } from '../gitService';
import { KeyNoopCommand } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick';
import * as path from 'path';
export class FileHistoryQuickPick {

+ 14
- 0
src/quickPicks/quickPicks.ts Wyświetl plik

@ -0,0 +1,14 @@
'use strict';
export * from './branchesAndTagsQuickPick';
export * from './branchesQuickPick';
export * from './branchHistoryQuickPick';
export * from './commitFileQuickPick';
export * from './commitQuickPick';
export * from './commitsQuickPick';
export * from './commonQuickPicks';
export * from './fileHistoryQuickPick';
export * from './remotesQuickPick';
export * from './repositoriesQuickPick';
export * from './repoStatusQuickPick';
export * from './stashListQuickPick';

src/quickPicks/remotes.ts → src/quickPicks/remotesQuickPick.ts Wyświetl plik

@ -2,7 +2,7 @@
import { Strings } from '../system';
import { QuickPickOptions, window } from 'vscode';
import { Commands, OpenInRemoteCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './common';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { getNameFromRemoteResource, GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../gitService';
import * as path from 'path';

src/quickPicks/repoStatus.ts → src/quickPicks/repoStatusQuickPick.ts Wyświetl plik

@ -1,327 +1,327 @@
'use strict';
import { Iterables, Strings } from '../system';
import { commands, QuickPickOptions, TextDocumentShowOptions, window } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, OpenFileCommandQuickPickItem, QuickPickItem } from './common';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitCommitType, GitLogCommit, GitService, GitStatus, GitStatusFile, GitStatusFileStatus, GitUri } from '../gitService';
import { Keys } from '../keyboard';
import * as path from 'path';
export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPickItem {
public readonly status: GitStatusFile;
private readonly commit: GitLogCommit;
constructor(
status: GitStatusFile,
realIndexStatus?: GitStatusFileStatus,
item?: QuickPickItem
) {
const octicon = status.getOcticon();
const description = status.getFormattedDirectory(true);
super(status.uri, item || {
label: `${status.staged ? '$(check)' : GlyphChars.Space.repeat(3)}${Strings.pad(octicon, 2, 2)} ${path.basename(status.fileName)}`,
description: description
});
this.status = status;
if (status.indexStatus !== undefined) {
this.commit = new GitLogCommit(GitCommitType.File, status.repoPath, GitService.stagedUncommittedSha, 'You', undefined, new Date(), '', status.fileName, [status], status.status, status.originalFileName, 'HEAD', status.fileName);
}
else {
this.commit = new GitLogCommit(GitCommitType.File, status.repoPath, GitService.uncommittedSha, 'You', undefined, new Date(), '', status.fileName, [status], status.status, status.originalFileName, realIndexStatus !== undefined ? GitService.stagedUncommittedSha : 'HEAD', status.fileName);
}
}
onDidPressKey(key: Keys): Promise<{} | undefined> {
return commands.executeCommand(Commands.DiffWithPrevious,
GitUri.fromFileStatus(this.status, this.status.repoPath),
{
commit: this.commit,
line: 0,
showOptions: {
preserveFocus: true,
preview: false
} as TextDocumentShowOptions
} as DiffWithPreviousCommandArgs) as Promise<{} | undefined>;
}
}
export class OpenStatusFilesCommandQuickPickItem extends CommandQuickPickItem {
constructor(
statuses: GitStatusFile[],
item?: QuickPickItem
) {
const uris = statuses.map(f => f.uri);
super(item || {
label: `$(file-symlink-file) Open Changed Files`,
description: ''
// detail: `Opens all of the changed files in the repository`
}, Commands.OpenChangedFiles, [
undefined,
{
uris
} as OpenChangedFilesCommandArgs
]
);
}
}
interface ComputedStatus {
staged: number;
stagedAddsAndChanges: GitStatusFile[];
stagedStatus: string;
unstaged: number;
unstagedAddsAndChanges: GitStatusFile[];
unstagedStatus: string;
}
export class RepoStatusQuickPick {
private static computeStatus(files: GitStatusFile[]): ComputedStatus {
let stagedAdds = 0;
let unstagedAdds = 0;
let stagedChanges = 0;
let unstagedChanges = 0;
let stagedDeletes = 0;
let unstagedDeletes = 0;
const stagedAddsAndChanges: GitStatusFile[] = [];
const unstagedAddsAndChanges: GitStatusFile[] = [];
for (const f of files) {
switch (f.indexStatus) {
case 'A':
case '?':
stagedAdds++;
stagedAddsAndChanges.push(f);
break;
case 'D':
stagedDeletes++;
break;
case undefined:
break;
default:
stagedChanges++;
stagedAddsAndChanges.push(f);
break;
}
switch (f.workTreeStatus) {
case 'A':
case '?':
unstagedAdds++;
unstagedAddsAndChanges.push(f);
break;
case 'D':
unstagedDeletes++;
break;
case undefined:
break;
default:
unstagedChanges++;
unstagedAddsAndChanges.push(f);
break;
}
}
const staged = stagedAdds + stagedChanges + stagedDeletes;
const unstaged = unstagedAdds + unstagedChanges + unstagedDeletes;
return {
staged: staged,
stagedStatus: staged > 0 ? `+${stagedAdds} ~${stagedChanges} -${stagedDeletes}` : '',
stagedAddsAndChanges: stagedAddsAndChanges,
unstaged: unstaged,
unstagedStatus: unstaged > 0 ? `+${unstagedAdds} ~${unstagedChanges} -${unstagedDeletes}` : '',
unstagedAddsAndChanges: unstagedAddsAndChanges
};
}
static async show(status: GitStatus, goBackCommand?: CommandQuickPickItem): Promise<OpenStatusFileCommandQuickPickItem | OpenStatusFilesCommandQuickPickItem | CommandQuickPickItem | undefined> {
const items = [
...Iterables.flatMap(status.files, s => {
if (s.workTreeStatus !== undefined && s.indexStatus !== undefined) {
return [
new OpenStatusFileCommandQuickPickItem(s.with({ indexStatus: null }), s.indexStatus),
new OpenStatusFileCommandQuickPickItem(s.with({ workTreeStatus: null }))
];
}
else {
return [new OpenStatusFileCommandQuickPickItem(s)];
}
})
] as (OpenStatusFileCommandQuickPickItem | OpenStatusFilesCommandQuickPickItem | CommandQuickPickItem)[];
// Sort the status by staged and then filename
items.sort((a, b) => ((a as OpenStatusFileCommandQuickPickItem).status.staged ? -1 : 1) - ((b as OpenStatusFileCommandQuickPickItem).status.staged ? -1 : 1) ||
(a as OpenStatusFileCommandQuickPickItem).status.fileName.localeCompare((b as OpenStatusFileCommandQuickPickItem).status.fileName));
const currentCommand = new CommandQuickPickItem({
label: `go back ${GlyphChars.ArrowBack}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to ${GlyphChars.Space}$(git-branch) ${status.branch} status`
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
]
);
const computed = this.computeStatus(status.files);
if (computed.staged > 0) {
let index = 0;
const unstagedIndex = computed.unstaged > 0 ? status.files.findIndex(f => !f.staged) : -1;
if (unstagedIndex > -1) {
items.splice(unstagedIndex, 0, new CommandQuickPickItem({
label: `Unstaged Files`,
description: computed.unstagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
items.splice(unstagedIndex, 0, new OpenStatusFilesCommandQuickPickItem(computed.stagedAddsAndChanges, {
label: `${GlyphChars.Space.repeat(4)} $(file-symlink-file) Open Staged Files`,
description: ''
}));
items.push(new OpenStatusFilesCommandQuickPickItem(computed.unstagedAddsAndChanges, {
label: `${GlyphChars.Space.repeat(4)} $(file-symlink-file) Open Unstaged Files`,
description: ''
}));
}
items.splice(index++, 0, new CommandQuickPickItem({
label: `Staged Files`,
description: computed.stagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
else if (status.files.some(f => !f.staged)) {
items.splice(0, 0, new CommandQuickPickItem({
label: `Unstaged Files`,
description: computed.unstagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
if (status.files.length) {
items.push(new OpenStatusFilesCommandQuickPickItem(computed.stagedAddsAndChanges.concat(computed.unstagedAddsAndChanges)));
items.push(new CommandQuickPickItem({
label: '$(x) Close Unchanged Files',
description: ''
}, Commands.CloseUnchangedFiles));
}
else {
items.push(new CommandQuickPickItem({
label: `No changes in the working tree`,
description: ''
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
items.splice(0, 0, new CommandQuickPickItem({
label: `$(inbox) Show Stashed Changes`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows stashed changes in the repository`
}, Commands.ShowQuickStashList, [
GitUri.fromRepoPath(status.repoPath),
{
goBackCommand: currentCommand
} as ShowQuickStashListCommandArgs
])
);
if (status.upstream && status.state.ahead) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-upload)${GlyphChars.Space} ${status.state.ahead} Commit${status.state.ahead > 1 ? 's' : ''} ahead of ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows commits in ${GlyphChars.Space}$(git-branch) ${status.branch} but not ${GlyphChars.Space}$(git-branch) ${status.upstream}`
}, Commands.ShowQuickBranchHistory, [
GitUri.fromRepoPath(status.repoPath, `${status.upstream}..${status.branch}`),
{
branch: status.branch,
maxCount: 0,
goBackCommand: currentCommand
} as ShowQuickBranchHistoryCommandArgs
])
);
}
if (status.upstream && status.state.behind) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-download)${GlyphChars.Space} ${status.state.behind} Commit${status.state.behind > 1 ? 's' : ''} behind ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows commits in ${GlyphChars.Space}$(git-branch) ${status.upstream} but not ${GlyphChars.Space}$(git-branch) ${status.branch}${status.sha ? ` (since ${GlyphChars.Space}$(git-commit) ${GitService.shortenSha(status.sha)})` : ''}`
}, Commands.ShowQuickBranchHistory, [
GitUri.fromRepoPath(status.repoPath, `${status.branch}..${status.upstream}`),
{
branch: status.upstream,
maxCount: 0,
goBackCommand: currentCommand
} as ShowQuickBranchHistoryCommandArgs
])
);
}
if (status.upstream && !status.state.ahead && !status.state.behind) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(git-branch) ${status.branch} is up-to-date with ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: ''
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
if (goBackCommand) {
items.splice(0, 0, goBackCommand);
}
const scope = await Container.keyboard.beginScope({ left: goBackCommand });
const pick = await window.showQuickPick(items, {
matchOnDescription: true,
placeHolder: `status of ${status.branch}${status.upstream ? ` ${Strings.pad(GlyphChars.ArrowLeftRight, 1, 1)} ${status.upstream}` : ''}`,
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
onDidSelectItem: (item: QuickPickItem) => {
scope.setKeyCommand('right', item);
}
} as QuickPickOptions);
await scope.dispose();
return pick;
}
'use strict';
import { Iterables, Strings } from '../system';
import { commands, QuickPickOptions, TextDocumentShowOptions, window } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs, OpenChangedFilesCommandArgs, ShowQuickBranchHistoryCommandArgs, ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, OpenFileCommandQuickPickItem, QuickPickItem } from './commonQuickPicks';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitCommitType, GitLogCommit, GitService, GitStatus, GitStatusFile, GitStatusFileStatus, GitUri } from '../gitService';
import { Keys } from '../keyboard';
import * as path from 'path';
export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPickItem {
public readonly status: GitStatusFile;
private readonly commit: GitLogCommit;
constructor(
status: GitStatusFile,
realIndexStatus?: GitStatusFileStatus,
item?: QuickPickItem
) {
const octicon = status.getOcticon();
const description = status.getFormattedDirectory(true);
super(status.uri, item || {
label: `${status.staged ? '$(check)' : GlyphChars.Space.repeat(3)}${Strings.pad(octicon, 2, 2)} ${path.basename(status.fileName)}`,
description: description
});
this.status = status;
if (status.indexStatus !== undefined) {
this.commit = new GitLogCommit(GitCommitType.File, status.repoPath, GitService.stagedUncommittedSha, 'You', undefined, new Date(), '', status.fileName, [status], status.status, status.originalFileName, 'HEAD', status.fileName);
}
else {
this.commit = new GitLogCommit(GitCommitType.File, status.repoPath, GitService.uncommittedSha, 'You', undefined, new Date(), '', status.fileName, [status], status.status, status.originalFileName, realIndexStatus !== undefined ? GitService.stagedUncommittedSha : 'HEAD', status.fileName);
}
}
onDidPressKey(key: Keys): Promise<{} | undefined> {
return commands.executeCommand(Commands.DiffWithPrevious,
GitUri.fromFileStatus(this.status, this.status.repoPath),
{
commit: this.commit,
line: 0,
showOptions: {
preserveFocus: true,
preview: false
} as TextDocumentShowOptions
} as DiffWithPreviousCommandArgs) as Promise<{} | undefined>;
}
}
export class OpenStatusFilesCommandQuickPickItem extends CommandQuickPickItem {
constructor(
statuses: GitStatusFile[],
item?: QuickPickItem
) {
const uris = statuses.map(f => f.uri);
super(item || {
label: `$(file-symlink-file) Open Changed Files`,
description: ''
// detail: `Opens all of the changed files in the repository`
}, Commands.OpenChangedFiles, [
undefined,
{
uris
} as OpenChangedFilesCommandArgs
]
);
}
}
interface ComputedStatus {
staged: number;
stagedAddsAndChanges: GitStatusFile[];
stagedStatus: string;
unstaged: number;
unstagedAddsAndChanges: GitStatusFile[];
unstagedStatus: string;
}
export class RepoStatusQuickPick {
private static computeStatus(files: GitStatusFile[]): ComputedStatus {
let stagedAdds = 0;
let unstagedAdds = 0;
let stagedChanges = 0;
let unstagedChanges = 0;
let stagedDeletes = 0;
let unstagedDeletes = 0;
const stagedAddsAndChanges: GitStatusFile[] = [];
const unstagedAddsAndChanges: GitStatusFile[] = [];
for (const f of files) {
switch (f.indexStatus) {
case 'A':
case '?':
stagedAdds++;
stagedAddsAndChanges.push(f);
break;
case 'D':
stagedDeletes++;
break;
case undefined:
break;
default:
stagedChanges++;
stagedAddsAndChanges.push(f);
break;
}
switch (f.workTreeStatus) {
case 'A':
case '?':
unstagedAdds++;
unstagedAddsAndChanges.push(f);
break;
case 'D':
unstagedDeletes++;
break;
case undefined:
break;
default:
unstagedChanges++;
unstagedAddsAndChanges.push(f);
break;
}
}
const staged = stagedAdds + stagedChanges + stagedDeletes;
const unstaged = unstagedAdds + unstagedChanges + unstagedDeletes;
return {
staged: staged,
stagedStatus: staged > 0 ? `+${stagedAdds} ~${stagedChanges} -${stagedDeletes}` : '',
stagedAddsAndChanges: stagedAddsAndChanges,
unstaged: unstaged,
unstagedStatus: unstaged > 0 ? `+${unstagedAdds} ~${unstagedChanges} -${unstagedDeletes}` : '',
unstagedAddsAndChanges: unstagedAddsAndChanges
};
}
static async show(status: GitStatus, goBackCommand?: CommandQuickPickItem): Promise<OpenStatusFileCommandQuickPickItem | OpenStatusFilesCommandQuickPickItem | CommandQuickPickItem | undefined> {
const items = [
...Iterables.flatMap(status.files, s => {
if (s.workTreeStatus !== undefined && s.indexStatus !== undefined) {
return [
new OpenStatusFileCommandQuickPickItem(s.with({ indexStatus: null }), s.indexStatus),
new OpenStatusFileCommandQuickPickItem(s.with({ workTreeStatus: null }))
];
}
else {
return [new OpenStatusFileCommandQuickPickItem(s)];
}
})
] as (OpenStatusFileCommandQuickPickItem | OpenStatusFilesCommandQuickPickItem | CommandQuickPickItem)[];
// Sort the status by staged and then filename
items.sort((a, b) => ((a as OpenStatusFileCommandQuickPickItem).status.staged ? -1 : 1) - ((b as OpenStatusFileCommandQuickPickItem).status.staged ? -1 : 1) ||
(a as OpenStatusFileCommandQuickPickItem).status.fileName.localeCompare((b as OpenStatusFileCommandQuickPickItem).status.fileName));
const currentCommand = new CommandQuickPickItem({
label: `go back ${GlyphChars.ArrowBack}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to ${GlyphChars.Space}$(git-branch) ${status.branch} status`
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
]
);
const computed = this.computeStatus(status.files);
if (computed.staged > 0) {
let index = 0;
const unstagedIndex = computed.unstaged > 0 ? status.files.findIndex(f => !f.staged) : -1;
if (unstagedIndex > -1) {
items.splice(unstagedIndex, 0, new CommandQuickPickItem({
label: `Unstaged Files`,
description: computed.unstagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
items.splice(unstagedIndex, 0, new OpenStatusFilesCommandQuickPickItem(computed.stagedAddsAndChanges, {
label: `${GlyphChars.Space.repeat(4)} $(file-symlink-file) Open Staged Files`,
description: ''
}));
items.push(new OpenStatusFilesCommandQuickPickItem(computed.unstagedAddsAndChanges, {
label: `${GlyphChars.Space.repeat(4)} $(file-symlink-file) Open Unstaged Files`,
description: ''
}));
}
items.splice(index++, 0, new CommandQuickPickItem({
label: `Staged Files`,
description: computed.stagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
else if (status.files.some(f => !f.staged)) {
items.splice(0, 0, new CommandQuickPickItem({
label: `Unstaged Files`,
description: computed.unstagedStatus
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
if (status.files.length) {
items.push(new OpenStatusFilesCommandQuickPickItem(computed.stagedAddsAndChanges.concat(computed.unstagedAddsAndChanges)));
items.push(new CommandQuickPickItem({
label: '$(x) Close Unchanged Files',
description: ''
}, Commands.CloseUnchangedFiles));
}
else {
items.push(new CommandQuickPickItem({
label: `No changes in the working tree`,
description: ''
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
items.splice(0, 0, new CommandQuickPickItem({
label: `$(inbox) Show Stashed Changes`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows stashed changes in the repository`
}, Commands.ShowQuickStashList, [
GitUri.fromRepoPath(status.repoPath),
{
goBackCommand: currentCommand
} as ShowQuickStashListCommandArgs
])
);
if (status.upstream && status.state.ahead) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-upload)${GlyphChars.Space} ${status.state.ahead} Commit${status.state.ahead > 1 ? 's' : ''} ahead of ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows commits in ${GlyphChars.Space}$(git-branch) ${status.branch} but not ${GlyphChars.Space}$(git-branch) ${status.upstream}`
}, Commands.ShowQuickBranchHistory, [
GitUri.fromRepoPath(status.repoPath, `${status.upstream}..${status.branch}`),
{
branch: status.branch,
maxCount: 0,
goBackCommand: currentCommand
} as ShowQuickBranchHistoryCommandArgs
])
);
}
if (status.upstream && status.state.behind) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-download)${GlyphChars.Space} ${status.state.behind} Commit${status.state.behind > 1 ? 's' : ''} behind ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows commits in ${GlyphChars.Space}$(git-branch) ${status.upstream} but not ${GlyphChars.Space}$(git-branch) ${status.branch}${status.sha ? ` (since ${GlyphChars.Space}$(git-commit) ${GitService.shortenSha(status.sha)})` : ''}`
}, Commands.ShowQuickBranchHistory, [
GitUri.fromRepoPath(status.repoPath, `${status.branch}..${status.upstream}`),
{
branch: status.upstream,
maxCount: 0,
goBackCommand: currentCommand
} as ShowQuickBranchHistoryCommandArgs
])
);
}
if (status.upstream && !status.state.ahead && !status.state.behind) {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(git-branch) ${status.branch} is up-to-date with ${GlyphChars.Space}$(git-branch) ${status.upstream}`,
description: ''
}, Commands.ShowQuickRepoStatus, [
undefined,
{
goBackCommand
} as ShowQuickRepoStatusCommandArgs
])
);
}
if (goBackCommand) {
items.splice(0, 0, goBackCommand);
}
const scope = await Container.keyboard.beginScope({ left: goBackCommand });
const pick = await window.showQuickPick(items, {
matchOnDescription: true,
placeHolder: `status of ${status.branch}${status.upstream ? ` ${Strings.pad(GlyphChars.ArrowLeftRight, 1, 1)} ${status.upstream}` : ''}`,
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
onDidSelectItem: (item: QuickPickItem) => {
scope.setKeyCommand('right', item);
}
} as QuickPickOptions);
await scope.dispose();
return pick;
}
}

src/quickPicks/repositories.ts → src/quickPicks/repositoriesQuickPick.ts Wyświetl plik

@ -1,9 +1,9 @@
'use strict';
import { Iterables } from '../system';
import { QuickPickItem, QuickPickOptions, window } from 'vscode';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks';
import { Container } from '../container';
import { Repository } from '../gitService';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from '../quickPicks';
export class RepositoryQuickPickItem implements QuickPickItem {

src/quickPicks/stashList.ts → src/quickPicks/stashListQuickPick.ts Wyświetl plik

@ -6,7 +6,7 @@ import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitStash } from '../gitService';
import { KeyNoopCommand } from '../keyboard';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from '../quickPicks';
import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from '../quickPicks/quickPicks';
export class StashListQuickPick {

Ładowanie…
Anuluj
Zapisz