|
@ -129,10 +129,10 @@ export class BranchTrackingStatusNode extends ViewNode implement |
|
|
switch (this.upstreamType) { |
|
|
switch (this.upstreamType) { |
|
|
case 'ahead': |
|
|
case 'ahead': |
|
|
label = `${Strings.pluralize('commit', this.status.state.ahead)} ahead`; |
|
|
label = `${Strings.pluralize('commit', this.status.state.ahead)} ahead`; |
|
|
|
|
|
tooltip = `${this.branch.name} is ${label} of ${this.status.upstream}`; |
|
|
if (!this.isReposView) { |
|
|
if (!this.isReposView) { |
|
|
label = `${this.root ? `${this.branch.name} is ` : ''}${label} of ${this.status.upstream}`; |
|
|
label = `${this.root ? `${this.branch.name} is ` : ''}${label} of ${this.status.upstream}`; |
|
|
} |
|
|
} |
|
|
tooltip = `${label} of ${this.status.upstream}`; |
|
|
|
|
|
|
|
|
|
|
|
collapsibleState = !this.isReposView |
|
|
collapsibleState = !this.isReposView |
|
|
? TreeItemCollapsibleState.Expanded |
|
|
? TreeItemCollapsibleState.Expanded |
|
@ -146,10 +146,10 @@ export class BranchTrackingStatusNode extends ViewNode implement |
|
|
|
|
|
|
|
|
case 'behind': |
|
|
case 'behind': |
|
|
label = `${Strings.pluralize('commit', this.status.state.behind)} behind`; |
|
|
label = `${Strings.pluralize('commit', this.status.state.behind)} behind`; |
|
|
|
|
|
tooltip = `${this.branch.name} is ${label} ${this.status.upstream}`; |
|
|
if (!this.isReposView) { |
|
|
if (!this.isReposView) { |
|
|
label = `${this.root ? `${this.branch.name} is ` : ''}${label} ${this.status.upstream}`; |
|
|
label = `${this.root ? `${this.branch.name} is ` : ''}${label} ${this.status.upstream}`; |
|
|
} |
|
|
} |
|
|
tooltip = `${label} ${this.status.upstream}`; |
|
|
|
|
|
|
|
|
|
|
|
collapsibleState = TreeItemCollapsibleState.Collapsed; |
|
|
collapsibleState = TreeItemCollapsibleState.Collapsed; |
|
|
contextValue = this.root |
|
|
contextValue = this.root |
|
@ -161,10 +161,10 @@ export class BranchTrackingStatusNode extends ViewNode implement |
|
|
|
|
|
|
|
|
case 'same': |
|
|
case 'same': |
|
|
label = `${this.branch.name} is up to date`; |
|
|
label = `${this.branch.name} is up to date`; |
|
|
|
|
|
tooltip = `${label} with ${this.status.upstream}`; |
|
|
if (!this.isReposView) { |
|
|
if (!this.isReposView) { |
|
|
label += ` with ${this.status.upstream}`; |
|
|
label += ` with ${this.status.upstream}`; |
|
|
} |
|
|
} |
|
|
tooltip = `${label} with ${this.status.upstream}`; |
|
|
|
|
|
|
|
|
|
|
|
collapsibleState = TreeItemCollapsibleState.None; |
|
|
collapsibleState = TreeItemCollapsibleState.None; |
|
|
contextValue = this.root ? ContextValues.StatusSameAsUpstream : undefined; |
|
|
contextValue = this.root ? ContextValues.StatusSameAsUpstream : undefined; |
|
@ -185,9 +185,10 @@ export class BranchTrackingStatusNode extends ViewNode implement |
|
|
const item = new TreeItem(label, collapsibleState); |
|
|
const item = new TreeItem(label, collapsibleState); |
|
|
item.id = this.id; |
|
|
item.id = this.id; |
|
|
item.contextValue = contextValue; |
|
|
item.contextValue = contextValue; |
|
|
item.description = lastFetched |
|
|
|
|
|
? `Last fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}` |
|
|
|
|
|
: undefined; |
|
|
|
|
|
|
|
|
if (lastFetched) { |
|
|
|
|
|
item.description = `Last fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`; |
|
|
|
|
|
tooltip += `\n${item.description}`; |
|
|
|
|
|
} |
|
|
item.iconPath = new ThemeIcon(icon); |
|
|
item.iconPath = new ThemeIcon(icon); |
|
|
item.tooltip = tooltip; |
|
|
item.tooltip = tooltip; |
|
|
|
|
|
|
|
|