twmr / gerrit.el

gerrit integration in emacs
43 stars 6 forks source link

Remove gerrit-rest--escape-project and add new sync-v2 function #42

Closed twmr closed 2 years ago

twmr commented 2 years ago

gerrit-rest--escape-project can be removed in favor of the url-build-query-string function, which escapes all fields in the query string. gerrit-rest--escape-project was also used to determine the unique-changeid. Since the branch name might also contain chars that need to be escaped, url-hexify-string is used on the whole unique-changeid string instead of gerrit-rest--escape-project.

twmr commented 2 years ago

There is an issue with this PR, which I have to fix. I'll first revert this PR.

The issue is that the query string seems to be wrongly escaped

;; fails
(gerrit-rest-sync-v2 "GET" "/accounts/"
             :params '(("q" "name:thomas+is:active")
                   ("o" "DETAILS")
                   ("S" 0))
             :debug t)

;; works
(gerrit-rest-sync "GET" nil "/accounts/?q=name:thomas+is:active&o=DETAILS")