Closed nagy closed 10 months ago
This happens when attempting to close a merge request in a gitlab repository:
Debugger entered--Lisp error: (wrong-number-of-arguments ((t) (repo topic) (progn (forge--set-topic-field repo topic 'state_event (let* ((val (eieio-oref topic ...))) (cond ((eq val ...) (let nil "reopen")) ((eq val ...) (let nil "close")) (t (let ... ...))))))) 3) ((closure (t) (repo topic) (progn (forge--set-topic-field repo topic 'state_event (let* ((val (eieio-oref topic ...))) (cond ((eq val ...) (let nil "reopen")) ((eq val ...) (let nil "close")) (t (let ... ...))))))) #<forge-gitlab-repository forge-gitlab-repository-24354f4> #<forge-pullreq forge-pullreq-59db1d4> closed) (apply (closure (t) (repo topic) (progn (forge--set-topic-field repo topic 'state_event (let* ((val (eieio-oref topic ...))) (cond ((eq val ...) (let nil "reopen")) ((eq val ...) (let nil "close")) (t (let ... ...))))))) #<forge-gitlab-repository forge-gitlab-repository-24354f4> (#<forge-pullreq forge-pullreq-59db1d4> closed)) (forge--set-topic-state #<forge-gitlab-repository forge-gitlab-repository-24354f4> #<forge-pullreq forge-pullreq-59db1d4> closed) (funcall forge--set-topic-state #<forge-gitlab-repository forge-gitlab-repository-24354f4> #<forge-pullreq forge-pullreq-59db1d4> closed) (forge--topic-set state closed) (forge-edit-topic-state)
That is because in forge-gitlab.el, the function accepts two arguments:
forge-gitlab.el
(cl-defmethod forge--set-topic-state ((repo forge-gitlab-repository) topic) (forge--set-topic-field repo topic 'state_event (pcase-exhaustive (oref topic state) ('closed "reopen") ('open "close"))))
But in forge-topic.el , it is being called with three arguments:
forge-topic.el
(defun forge--topic-set (slot value &optional topic) (unless topic (setq topic (forge-current-topic t))) (funcall (intern (format "forge--set-topic-%s" slot)) (forge-get-repository topic) topic value))
Thanks for the report!
This happens when attempting to close a merge request in a gitlab repository:
That is because in
forge-gitlab.el
, the function accepts two arguments:But in
forge-topic.el
, it is being called with three arguments: