@@ -372,8 +372,31 @@ export class GitLabRemote extends RemoteProvider<GitLabRepositoryDescriptor> {
372
372
return this . encodeUrl ( `${ this . baseUrl } /-/commit/${ sha } ` ) ;
373
373
}
374
374
375
- protected override getUrlForComparison ( base : string , compare : string , notation : '..' | '...' ) : string {
376
- return this . encodeUrl ( `${ this . baseUrl } /-/compare/${ base } ${ notation } ${ compare } ` ) ;
375
+ protected override getUrlForComparison ( base : string , head : string , notation : '..' | '...' ) : string {
376
+ return this . encodeUrl ( `${ this . baseUrl } /-/compare/${ base } ${ notation } ${ head } ` ) ;
377
+ }
378
+
379
+ protected override getUrlForCreatePullRequest (
380
+ base : { branch ?: string ; remote : { path : string ; url : string } } ,
381
+ head : { branch : string ; remote : { path : string ; url : string } } ,
382
+ options ?: { title ?: string ; description ?: string } ,
383
+ ) : string | undefined {
384
+ const query = new URLSearchParams ( {
385
+ utf8 : '✓' ,
386
+ 'merge_request["source_branch"]' : head . branch ,
387
+ 'merge_request["target_branch"]' : base . branch ?? '' ,
388
+ // TODO: figure this out
389
+ // 'merge_request["source_project_id"]': this.path,
390
+ // 'merge_request["target_project_id"]': this.path,
391
+ } ) ;
392
+ if ( options ?. title ) {
393
+ query . set ( 'merge_request[title]' , options . title ) ;
394
+ }
395
+ if ( options ?. description ) {
396
+ query . set ( 'merge_request[description]' , options . description ) ;
397
+ }
398
+
399
+ return `${ this . encodeUrl ( `${ this . baseUrl } /-/merge_requests/new` ) } ?${ query . toString ( ) } ` ;
377
400
}
378
401
379
402
protected getUrlForFile ( fileName : string , branch ?: string , sha ?: string , range ?: Range ) : string {
0 commit comments