@ -96,6 +96,7 @@ import type {
GraphMissingRefsMetadataType ,
GraphMissingRefsMetadataType ,
GraphPullRequestMetadata ,
GraphPullRequestMetadata ,
GraphRefMetadata ,
GraphRefMetadata ,
GraphRefMetadataType ,
GraphRepository ,
GraphRepository ,
GraphSelectedRows ,
GraphSelectedRows ,
GraphUpstreamMetadata ,
GraphUpstreamMetadata ,
@ -131,8 +132,10 @@ import {
GetMissingAvatarsCommandType ,
GetMissingAvatarsCommandType ,
GetMissingRefsMetadataCommandType ,
GetMissingRefsMetadataCommandType ,
GetMoreRowsCommandType ,
GetMoreRowsCommandType ,
GraphRefMetadataTypes ,
SearchCommandType ,
SearchCommandType ,
SearchOpenInViewCommandType ,
SearchOpenInViewCommandType ,
supportedRefMetadataTypes ,
UpdateColumnsCommandType ,
UpdateColumnsCommandType ,
UpdateExcludeTypeCommandType ,
UpdateExcludeTypeCommandType ,
UpdateIncludeOnlyRefsCommandType ,
UpdateIncludeOnlyRefsCommandType ,
@ -546,6 +549,7 @@ export class GraphWebview extends WebviewBase {
configuration . changed ( e , 'graph.highlightRowsOnRefHover' ) ||
configuration . changed ( e , 'graph.highlightRowsOnRefHover' ) ||
configuration . changed ( e , 'graph.scrollRowPadding' ) ||
configuration . changed ( e , 'graph.scrollRowPadding' ) ||
configuration . changed ( e , 'graph.showGhostRefsOnRowHover' ) ||
configuration . changed ( e , 'graph.showGhostRefsOnRowHover' ) ||
configuration . changed ( e , 'graph.pullRequests.enabled' ) ||
configuration . changed ( e , 'graph.showRemoteNames' ) ||
configuration . changed ( e , 'graph.showRemoteNames' ) ||
configuration . changed ( e , 'graph.showUpstreamStatus' )
configuration . changed ( e , 'graph.showUpstreamStatus' )
) {
) {
@ -739,14 +743,14 @@ export class GraphWebview extends WebviewBase {
}
}
for ( const type of missingTypes ) {
for ( const type of missingTypes ) {
if ( type !== 'pullRequests' && type !== 'upstream' ) {
if ( ! supportedRefMetadataTypes . includes ( type ) ) {
( metadata as any ) [ type ] = null ;
( metadata as any ) [ type ] = null ;
this . _refsMetadata . set ( id , metadata ) ;
this . _refsMetadata . set ( id , metadata ) ;
continue ;
continue ;
}
}
if ( type === 'pullRequests' ) {
if ( type === GraphRefMetadataTypes . PullRequest ) {
const pr = await branch ? . getAssociatedPullRequest ( ) ;
const pr = await branch ? . getAssociatedPullRequest ( ) ;
if ( pr == null ) {
if ( pr == null ) {
@ -783,7 +787,7 @@ export class GraphWebview extends WebviewBase {
continue ;
continue ;
}
}
if ( type === 'upstream' ) {
if ( type === GraphRefMetadataTypes . Upstream ) {
const upstream = branch ? . upstream ;
const upstream = branch ? . upstream ;
if ( upstream == null || upstream == undefined || upstream . missing ) {
if ( upstream == null || upstream == undefined || upstream . missing ) {
@ -1555,18 +1559,31 @@ export class GraphWebview extends WebviewBase {
dateFormat :
dateFormat :
configuration . get ( 'graph.dateFormat' ) ? ? configuration . get ( 'defaultDateFormat' ) ? ? 'short+short' ,
configuration . get ( 'graph.dateFormat' ) ? ? configuration . get ( 'defaultDateFormat' ) ? ? 'short+short' ,
dateStyle : configuration.get ( 'graph.dateStyle' ) ? ? configuration . get ( 'defaultDateStyle' ) ,
dateStyle : configuration.get ( 'graph.dateStyle' ) ? ? configuration . get ( 'defaultDateStyle' ) ,
enabledRefMetadataTypes : this.getEnabledRefMetadataTypes ( ) ,
dimMergeCommits : configuration.get ( 'graph.dimMergeCommits' ) ,
dimMergeCommits : configuration.get ( 'graph.dimMergeCommits' ) ,
enableMultiSelection : false ,
enableMultiSelection : false ,
highlightRowsOnRefHover : configuration.get ( 'graph.highlightRowsOnRefHover' ) ,
highlightRowsOnRefHover : configuration.get ( 'graph.highlightRowsOnRefHover' ) ,
scrollRowPadding : configuration.get ( 'graph.scrollRowPadding' ) ,
scrollRowPadding : configuration.get ( 'graph.scrollRowPadding' ) ,
showGhostRefsOnRowHover : configuration.get ( 'graph.showGhostRefsOnRowHover' ) ,
showGhostRefsOnRowHover : configuration.get ( 'graph.showGhostRefsOnRowHover' ) ,
showRemoteNamesOnRefs : configuration.get ( 'graph.showRemoteNames' ) ,
showRemoteNamesOnRefs : configuration.get ( 'graph.showRemoteNames' ) ,
showUpstreamStatus : configuration.get ( 'graph.showUpstreamStatus' ) ,
idLength : configuration.get ( 'advanced.abbreviatedShaLength' ) ,
idLength : configuration.get ( 'advanced.abbreviatedShaLength' ) ,
} ;
} ;
return config ;
return config ;
}
}
private getEnabledRefMetadataTypes ( ) : GraphRefMetadataType [ ] {
const types : GraphRefMetadataType [ ] = [ ] ;
if ( configuration . get ( 'graph.pullRequests.enabled' ) ) {
types . push ( GraphRefMetadataTypes . PullRequest as GraphRefMetadataType ) ;
}
if ( configuration . get ( 'graph.showUpstreamStatus' ) ) {
types . push ( GraphRefMetadataTypes . Upstream as GraphRefMetadataType ) ;
}
return types ;
}
private async getGraphAccess() {
private async getGraphAccess() {
let access = await this . container . git . access ( PlusFeatures . Graph , this . repository ? . path ) ;
let access = await this . container . git . access ( PlusFeatures . Graph , this . repository ? . path ) ;
this . _etagSubscription = this . container . subscription . etag ;
this . _etagSubscription = this . container . subscription . etag ;