Adds Show Branch History command

Renames Show Repository History to Show Current Branch History
Doesn't migrate data yet
This commit is contained in:
Eric Amodio
2017-03-22 03:09:13 -04:00
parent 43e4337358
commit 9867e7065d
14 changed files with 98 additions and 47 deletions

View File

@@ -6,7 +6,7 @@ import { GitUri, IGitLog } from '../gitService';
import { CommitQuickPickItem } from './gitQuickPicks';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './quickPicks';
export class RepoHistoryQuickPick {
export class BranchHistoryQuickPick {
static showProgress(branch: string) {
return showQuickPickProgress(`${branch} history \u2014 search by commit message, filename, or sha`,
@@ -27,7 +27,7 @@ export class RepoHistoryQuickPick {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(sync) Show All Commits`,
description: `\u00a0 \u2014 \u00a0\u00a0 this may take a while`
}, Commands.ShowQuickRepoHistory, [
}, Commands.ShowQuickBranchHistory, [
new GitUri(Uri.file(log.repoPath), { fileName: '', repoPath: log.repoPath }),
branch,
0,
@@ -38,14 +38,14 @@ export class RepoHistoryQuickPick {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(history) Show Branch History`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows \u00a0$(git-branch) ${branch} history`
}, Commands.ShowQuickRepoHistory, [
}, Commands.ShowQuickBranchHistory, [
new GitUri(Uri.file(log.repoPath), { fileName: '', repoPath: log.repoPath }),
branch,
undefined,
new CommandQuickPickItem({
label: `go back \u21A9`,
description: `\u00a0 \u2014 \u00a0\u00a0 to \u00a0$(git-branch) ${branch} history`
}, Commands.ShowQuickRepoHistory, [uri, branch, log.maxCount, goBackCommand, log])
}, Commands.ShowQuickBranchHistory, [uri, branch, log.maxCount, goBackCommand, log])
]));
}
@@ -57,14 +57,14 @@ export class RepoHistoryQuickPick {
const npc = new CommandQuickPickItem({
label: `$(arrow-right) Show Next Commits`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows ${log.maxCount} newer commits`
}, Commands.ShowQuickRepoHistory, [uri, branch, log.maxCount, goBackCommand, undefined, nextPageCommand]);
}, Commands.ShowQuickBranchHistory, [uri, branch, log.maxCount, goBackCommand, undefined, nextPageCommand]);
const last = Iterables.last(log.commits.values());
previousPageCommand = new CommandQuickPickItem({
label: `$(arrow-left) Show Previous Commits`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows ${log.maxCount} older commits`
}, Commands.ShowQuickRepoHistory, [new GitUri(uri ? uri : last.uri, last), branch, log.maxCount, goBackCommand, undefined, npc]);
}, Commands.ShowQuickBranchHistory, [new GitUri(uri ? uri : last.uri, last), branch, log.maxCount, goBackCommand, undefined, npc]);
items.splice(0, 0, previousPageCommand);
}

View File

@@ -79,10 +79,8 @@ export class FileHistoryQuickPick {
items.splice(index, 0, new CommandQuickPickItem({
label: `$(history) Show Branch History`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows the current branch history`
}, Commands.ShowQuickRepoHistory,
}, Commands.ShowQuickCurrentBranchHistory,
[
undefined,
undefined,
undefined,
new CommandQuickPickItem({
label: `go back \u21A9`,

View File

@@ -117,7 +117,7 @@ export class RepoStatusQuickPick {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-upload)\u00a0 ${status.state.ahead} Commits ahead of \u00a0$(git-branch) ${status.upstream}`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows commits in \u00a0$(git-branch) ${status.branch} but not \u00a0$(git-branch) ${status.upstream}`
}, Commands.ShowQuickRepoHistory, [
}, Commands.ShowQuickBranchHistory, [
new GitUri(Uri.file(status.repoPath), { fileName: '', repoPath: status.repoPath, sha: `${status.upstream}..${status.branch}` }),
status.branch,
0,
@@ -133,7 +133,7 @@ export class RepoStatusQuickPick {
items.splice(0, 0, new CommandQuickPickItem({
label: `$(cloud-download)\u00a0 ${status.state.behind} Commits behind \u00a0$(git-branch) ${status.upstream}`,
description: `\u00a0 \u2014 \u00a0\u00a0 shows commits in \u00a0$(git-branch) ${status.upstream} but not \u00a0$(git-branch) ${status.branch} (since \u00a0$(git-commit) ${status.sha.substring(0, 8)})`
}, Commands.ShowQuickRepoHistory, [
}, Commands.ShowQuickBranchHistory, [
new GitUri(Uri.file(status.repoPath), { fileName: '', repoPath: status.repoPath, sha: `${status.sha}..${status.upstream}` }),
status.upstream,
0,