Subject: 27.0.50; [PATCH] vc-hg: log incoming/outgoing must call vc-setup-buffer
From: Andrii Kolomoiets <[email-masked]>
To: [email-masked]
Date: Wed, 27 Nov 2019 09:04:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

1. emacs -Q
2. 'C-x v d' and open hg repository directory
3. 'I' to open incoming log
4. 'g' to revert *vc-incoming* buffer

Output is added to buffer content instead of replacing it.
Same with outgoing log.

vc-hg-log-incoming and vc-hg-log-outgoing must call vc-setup-buffer

* lisp/vc/vc-hg.el (vc-hg-log-incoming, vc-hg-log-outgoing): Call
  vc-setup-buffer.

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 17d38fa400..5ff1a6204b 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1378,10 +1378,12 @@ vc-hg-dir-extra-headers
      )))

(defun vc-hg-log-incoming (buffer remote-location)
+  (vc-setup-buffer buffer)
   (vc-hg-command buffer 1 nil "incoming" "-n" (unless (string= remote-location "")
                                                remote-location)))

(defun vc-hg-log-outgoing (buffer remote-location)
+  (vc-setup-buffer buffer)
   (vc-hg-command buffer 1 nil "outgoing" "-n" (unless (string= remote-location "")
                                                remote-location)))