Bug 215796

Summary: REGRESSION(r265601): invalid blame URL copied when `include_revision` is `false`
Product: WebKit Reporter: Devin Rousso <hi>
Component: Tools / TestsAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates, hi, joepeck, keith_miller, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 215440    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Devin Rousso 2020-08-24 21:57:42 PDT
# STEPS TO REPRODUCE:
1. copy `CopyWebKitPermalink.sublime-settings` into `Packages/User`
2. set `"include_revision"` to `false`
3. attempt to "Copy WebKit Permalink to Blame" in any file in the tree
 => URL is missing "?"
Comment 1 Devin Rousso 2020-08-24 21:59:58 PDT
Created attachment 407172 [details]
Patch
Comment 2 Daniel Bates 2020-08-24 22:40:55 PDT
Comment on attachment 407172 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407172&action=review

> Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:194
> +        return 'https://trac.webkit.org/browser/{}/{}?{}{}{}'.format(branch, path, revision, annotate_blame, line_number)

This doesn't look correct. Looks like ?&rev can be formed.
Comment 3 Devin Rousso 2020-08-25 10:46:24 PDT
Comment on attachment 407172 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407172&action=review

>> Tools/CopyPermalink/Sublime Text/CopyWebKitPermalink/CopyWebKitPermalink.py:194
>> +        return 'https://trac.webkit.org/browser/{}/{}?{}{}{}'.format(branch, path, revision, annotate_blame, line_number)
> 
> This doesn't look correct. Looks like ?&rev can be formed.

Yes, that was somewhat intentional.  I figured this would be easier and more straightforward than adding a bunch of `if`s to determine whether to put the `?` on the `revision` or on the `annotate_blame`.  AFAIK, having `?&` in a URL is valid, and it worked just fine with <https://trac.webkit.org/>.
Comment 4 EWS 2020-08-25 11:37:49 PDT
Committed r266135: <https://trac.webkit.org/changeset/266135>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407172 [details].
Comment 5 Radar WebKit Bug Importer 2020-08-25 11:38:20 PDT
<rdar://problem/67749448>