pull request needs to select the source branch manually
The bitbucket server URL is set to https://bitbucket.????.com
Then create a pull request from current branch, then web browser will open a link,
https://bitbucket.????.com/projects/hpss/repos/????/pull-requests?create
but the source branch is none and needs to be selected manually.
Comments (7)
-
repo owner -
I found the reason for this issue on windows. & character is contained in the URL, which causes URL is truncated.
Refer to https://stackoverflow.com/questions/44513063/how-to-open-a-url-with-cmd
Bitbucket server pull request URL pattern,
\${url}/projects/${owner}/repos/${repo}/pull-requests?create&sourceBranch=${encodedBranch}&t=1
The fix in extension.ts
export function activate(context: vscode.ExtensionContext) { //stuff... const result = bb.GetPullRequestURL(); result.then((url) => { let openUrlCommand: string; const command = platform.getRunCommand(); if (command === 'start') { // refer to https://stackoverflow.com/questions/44513063/how-to-open-a-url-with-cmd openUrlCommand = `${command} \"\" \"${url}\"`; } else { openUrlCommand = `${command} ${url}`; } console.log(`running ${openUrlCommand}`); cp.exec(`${openUrlCommand}`).on('error', (err: Error) => { vscode.window.showErrorMessage(`Couldn't open a browser window. Make sure you have a browser installed. ${err}`); }); }).catch((reason) => { vscode.window.showErrorMessage(`Couldn't start your pr: ${reason}`); }); //stuff... }
-
repo owner Great insight @Leo Cheng ! I pushed the fix with the 0.3.10 release, can you give it a go?
-
repo owner - changed status to resolved
Fixed on 0.3.10
-
I tried 0.3.10 release, it’s OK.
-
This issue still persists on MAC though windows works fine.
-
On Linux it also doesn’t work.
- Log in to comment
Thanks for filing it, I’ll try to reproduce it and report back.