提交 5cb18070 编写于 作者: P Peng Lyu

show indicator for current pr branch

上级 a1fd23d5
......@@ -149,4 +149,20 @@ export class PullRequestModel {
getUserGravatar(): string {
return this.prItem.user.avatar_url;
}
equals(other: PullRequestModel): boolean {
if (!other) {
return false;
}
if (this.prNumber !== other.prNumber) {
return false;
}
if (this.html_url !== other.html_url) {
return false;
}
return true;
}
}
......@@ -16,9 +16,9 @@ export class Remote {
if (this.remoteName !== remote.remoteName) {
return false;
}
if (this.url !== remote.url) {
return false;
}
// if (this.url !== remote.url) {
// return false;
// }
if (this.hostname !== remote.hostname) {
return false;
}
......
......@@ -17,6 +17,7 @@ import { toPRUri } from '../common/uri';
import * as fs from 'fs';
import { PullRequestModel, PRType } from '../common/models/pullRequestModel';
import { PullRequestGitHelper } from '../common/pullRequestGitHelper';
import { ReviewManager } from '../review/reviewManager';
export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | PullRequestModel | PRGroupActionTreeItem | FileChangeTreeItem>, vscode.TextDocumentContentProvider, vscode.DecorationProvider {
private static _instance: PRProvider;
......@@ -58,8 +59,10 @@ export class PRProvider implements vscode.TreeDataProvider<PRGroupTreeItem | Pul
}
if (element instanceof PullRequestModel) {
let currentBranchIsForThisPR = element.equals(ReviewManager.instance.currentPullRequest);
return {
label: element.prItem.title,
label: (currentBranchIsForThisPR ? ' * ' : '') + element.title,
tooltip: (currentBranchIsForThisPR ? 'Current Branch * ' : '') + element.title,
collapsibleState: 1,
contextValue: 'pullrequest',
iconPath: Resource.getGravatarUri(element)
......
......@@ -205,6 +205,7 @@ export class ReviewManager implements vscode.DecorationProvider {
this.statusBarItem.text = '$(git-branch) Pull Request #' + this._prNumber;
this.statusBarItem.command = 'pr.openInGitHub';
this.statusBarItem.show();
vscode.commands.executeCommand('pr.refreshList');
}
private async updateComments(): Promise<void> {
......@@ -530,6 +531,7 @@ export class ReviewManager implements vscode.DecorationProvider {
}
}
vscode.commands.executeCommand('pr.refreshList');
}
dispose() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册