Skip to content

Commit

Permalink
Changes diff to compare
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Apr 1, 2017
1 parent 0c13050 commit d59f4ef
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/commands/diffDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class DiffDirectoryCommand extends ActiveEditorCommand {

try {
const repoPath = await this.git.getRepoPathFromUri(uri);
if (!repoPath) return window.showWarningMessage(`Unable to open directory diff`);
if (!repoPath) return window.showWarningMessage(`Unable to open directory compare`);

if (!shaOrBranch1) {
const branches = await this.git.getBranches(repoPath);
Expand All @@ -49,7 +49,7 @@ export class DiffDirectoryCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffDirectoryCommand');
return window.showErrorMessage(`Unable to open directory diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open directory compare. See output channel for more details`);
}
}
}
6 changes: 3 additions & 3 deletions src/commands/diffLineWithPrevious.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {

try {
const blame = await this.git.getBlameForLine(gitUri, blameline);
if (!blame) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
if (!blame) return window.showWarningMessage(`Unable to open compare. File is probably not under source control`);

commit = blame.commit;

Expand All @@ -50,7 +50,7 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithPreviousLineCommand', `getBlameForLine(${blameline})`);
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}

Expand All @@ -65,7 +65,7 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithPreviousLineCommand', 'getVersionedFile');
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}
}
4 changes: 2 additions & 2 deletions src/commands/diffLineWithWorking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DiffLineWithWorkingCommand extends ActiveEditorCommand {

try {
const blame = await this.git.getBlameForLine(gitUri, blameline);
if (!blame) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
if (!blame) return window.showWarningMessage(`Unable to open compare. File is probably not under source control`);

commit = blame.commit;
// If the line is uncommitted, find the previous commit
Expand All @@ -40,7 +40,7 @@ export class DiffLineWithWorkingCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffLineWithWorkingCommand', `getBlameForLine(${blameline})`);
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/diffWithBranch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DiffWithBranchCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithBranchCommand', 'getVersionedFile');
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}
}
6 changes: 3 additions & 3 deletions src/commands/diffWithNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
const sha = (commit && commit.sha) || gitUri.sha;

const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, undefined, sha ? undefined : 2, rangeOrLine as Range);
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
if (!log) return window.showWarningMessage(`Unable to open compare. File is probably not under source control`);

commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());
}
catch (ex) {
Logger.error(ex, 'DiffWithNextCommand', `getLogForFile(${gitUri.repoPath}, ${gitUri.fsPath})`);
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}

Expand All @@ -67,7 +67,7 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithNextCommand', 'getVersionedFile');
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}
}
6 changes: 3 additions & 3 deletions src/commands/diffWithPrevious.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
const sha = (commit && commit.sha) || gitUri.sha;

const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, undefined, sha ? undefined : 2, rangeOrLine as Range);
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
if (!log) return window.showWarningMessage(`Unable to open compare. File is probably not under source control`);

commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());
}
catch (ex) {
Logger.error(ex, 'DiffWithPreviousCommand', `getLogForFile(${gitUri.repoPath}, ${gitUri.fsPath})`);
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}

Expand All @@ -69,7 +69,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithPreviousCommand', 'getVersionedFile');
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}
}
6 changes: 3 additions & 3 deletions src/commands/diffWithWorking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {

try {
commit = await this.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { firstIfMissing: true });
if (!commit) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
if (!commit) return window.showWarningMessage(`Unable to open compare. File is probably not under source control`);
}
catch (ex) {
Logger.error(ex, 'DiffWithWorkingCommand', `getLogCommit(${gitUri.repoPath}, ${gitUri.fsPath}, ${gitUri.sha})`);
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}

Expand All @@ -47,7 +47,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
}
catch (ex) {
Logger.error(ex, 'DiffWithWorkingCommand', 'getVersionedFile');
return window.showErrorMessage(`Unable to open diff. See output channel for more details`);
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
}
}
}

0 comments on commit d59f4ef

Please sign in to comment.