@@ -17,7 +17,7 @@ import Logger from '../common/logger';
1717import { Remote } from '../common/remote' ;
1818import { ITelemetry } from '../common/telemetry' ;
1919import { ClosedEvent , EventType , ReviewEvent } from '../common/timelineEvent' ;
20- import { resolvePath , Schemes , toPRUri , toReviewUri } from '../common/uri' ;
20+ import { resolvePath , reviewPath , Schemes , toPRUri , toReviewUri } from '../common/uri' ;
2121import { formatError , isDescendant } from '../common/utils' ;
2222import { InMemFileChangeModel , RemoteFileChangeModel } from '../view/fileChangeModel' ;
2323import { OctokitCommon } from './common' ;
@@ -1217,28 +1217,22 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
12171217 // Create URI pairs for the multi diff editor using review scheme
12181218 const args : [ vscode . Uri , vscode . Uri | undefined , vscode . Uri | undefined ] [ ] = [ ] ;
12191219 for ( const change of changes ) {
1220- const uri = vscode . Uri . file ( path . resolve ( repository . rootUri . fsPath , change . uri . fsPath ) ) ;
1221- const fileName = change . uri . fsPath ;
1220+ const rightRelativePath = path . relative ( repository . rootUri . fsPath , change . uri . fsPath ) ;
1221+ const rightPath = reviewPath ( rightRelativePath , commitSha ) ;
1222+ let rightUri = toReviewUri ( rightPath , rightRelativePath , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1223+
1224+ const leftRelativePath = path . relative ( repository . rootUri . fsPath , change . originalUri . fsPath ) ;
1225+ const leftPath = reviewPath ( leftRelativePath , parentSha ) ;
1226+ let leftUri = toReviewUri ( leftPath , ( change . status === GitChangeType . RENAME ) ? path . relative ( repository . rootUri . fsPath , change . originalUri . fsPath ) : leftRelativePath , undefined , parentSha , false , { base : true } , repository . rootUri ) ;
12221227
12231228 if ( change . status === GitChangeType . ADD ) {
12241229 // For added files, show against empty
1225- const headUri = toReviewUri ( uri , fileName , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1226- args . push ( [ headUri , undefined , headUri ] ) ;
1230+ args . push ( [ rightUri , undefined , rightUri ] ) ;
12271231 } else if ( change . status === GitChangeType . DELETE ) {
12281232 // For deleted files, show old version against empty
1229- const baseUri = toReviewUri ( uri , fileName , undefined , parentSha , false , { base : true } , repository . rootUri ) ;
1230- args . push ( [ uri , baseUri , undefined ] ) ;
1231- } else if ( change . status === GitChangeType . RENAME ) {
1232- // For renamed files, show old name against new name
1233- const baseFileName = change . originalUri . fsPath ;
1234- const baseUri = toReviewUri ( uri , baseFileName , undefined , parentSha , false , { base : true } , repository . rootUri ) ;
1235- const headUri = toReviewUri ( uri , fileName , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1236- args . push ( [ headUri , baseUri , headUri ] ) ;
1233+ args . push ( [ rightPath , leftUri , undefined ] ) ;
12371234 } else {
1238- // For modified files, show before and after
1239- const baseUri = toReviewUri ( uri , fileName , undefined , parentSha , false , { base : true } , repository . rootUri ) ;
1240- const headUri = toReviewUri ( uri , fileName , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1241- args . push ( [ headUri , baseUri , headUri ] ) ;
1235+ args . push ( [ rightUri , leftUri , rightUri ] ) ;
12421236 }
12431237 }
12441238
0 commit comments