Bug 215796 - REGRESSION(r265601): invalid blame URL copied when `include_revision` is `false`
Summary: REGRESSION(r265601): invalid blame URL copied when `include_revision` is `false`
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 215440
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-24 21:57 PDT by Devin Rousso
Modified: 2020-08-25 11:38 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.04 KB, patch)
2020-08-24 21:59 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>