Skip to content

Commit

Permalink
Add elisp functions for get/set description of patchset
Browse files Browse the repository at this point in the history
Change-Id: If3db6c2c59a0dfd28489086a55e90fd428168578
  • Loading branch information
twmr committed Feb 21, 2024
1 parent abc4000 commit 5d9449c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gerrit-rest.el
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,24 @@ A comment MESSAGE can be provided."
(resp (gerrit-rest-sync-v2 "GET" req)))
(assoc 'labels (cdr resp))))

(defun gerrit-rest-change-get-description (changenr patchsetnr)
"Return the description of a patchset with PATCHSETNR of a change CHANGENR."
(interactive "sEnter a changenr: \nsEnter a patchsetnr :")
(setq thi::patchsetnr 1)
(gerrit-rest-sync-v2 "GET"
(format "/changes/%s/revisions/%s/description"
changenr patchsetnr)))

(defun gerrit-rest-change-set-description (changenr patchsetnr description)
"Set the description of a patchset with PATCHSETNR of a change CHANGENR."
(interactive "sEnter a changenr: \nsEnter a patchset: \nsEnter a description: ")
(gerrit-rest-sync-v2 "PUT"
(format "/changes/%s/revisions/%s/description"
changenr patchsetnr)
:data (encode-coding-string
(json-encode
`((description . ,description))) 'utf-8)))

(defun gerrit-rest-change-query (expression)
"Return information about changes that match EXPRESSION."
(interactive "sEnter a search expression: ")
Expand Down

0 comments on commit 5d9449c

Please sign in to comment.