@@ -157,8 +157,26 @@ export class BitbucketServerRemote extends RemoteProvider {
157
157
return this . encodeUrl ( `${ this . baseUrl } /commits/${ sha } ` ) ;
158
158
}
159
159
160
- protected override getUrlForComparison ( base : string , compare : string , _notation : '..' | '...' ) : string {
161
- return this . encodeUrl ( `${ this . baseUrl } /branches/compare/${ base } %0D${ compare } ` ) . replace ( '%250D' , '%0D' ) ;
160
+ protected override getUrlForComparison ( base : string , head : string , _notation : '..' | '...' ) : string {
161
+ return this . encodeUrl ( `${ this . baseUrl } /branches/compare/${ base } %0D${ head } ` ) . replace ( '%250D' , '%0D' ) ;
162
+ }
163
+
164
+ protected override getUrlForCreatePullRequest (
165
+ base : { branch ?: string ; remote : { path : string ; url : string } } ,
166
+ head : { branch : string ; remote : { path : string ; url : string } } ,
167
+ options ?: { title ?: string ; description ?: string } ,
168
+ ) : string | undefined {
169
+ const query = new URLSearchParams ( { sourceBranch : head . branch , targetBranch : base . branch ?? '' } ) ;
170
+ // TODO: figure this out
171
+ // query.set('targetRepoId', base.repoId);
172
+ if ( options ?. title ) {
173
+ query . set ( 'title' , options . title ) ;
174
+ }
175
+ if ( options ?. description ) {
176
+ query . set ( 'description' , options . description ) ;
177
+ }
178
+
179
+ return `${ this . encodeUrl ( `${ this . baseUrl } /pull-requests?create` ) } &${ query . toString ( ) } ` ;
162
180
}
163
181
164
182
protected getUrlForFile ( fileName : string , branch ?: string , sha ?: string , range ?: Range ) : string {
0 commit comments