From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Is vc-diff-mergebase broken on master? Date: Fri, 03 Sep 2021 00:54:23 +0200 Message-ID: <87o89avba8.fsf@gmail.com> References: <87a6kyacqn.fsf@gmail.com> <89f53c5f-3936-bfb1-eb47-11c9a6bd8e5c@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15381"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 03 00:55:57 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLvcj-0003lo-7V for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Sep 2021 00:55:57 +0200 Original-Received: from localhost ([::1]:46134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLvch-000501-Go for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Sep 2021 18:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLvbM-0004EX-7F for emacs-devel@gnu.org; Thu, 02 Sep 2021 18:54:32 -0400 Original-Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:33370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLvbH-0001aP-0P for emacs-devel@gnu.org; Thu, 02 Sep 2021 18:54:31 -0400 Original-Received: by mail-wr1-x429.google.com with SMTP id b10so5447090wru.0 for ; Thu, 02 Sep 2021 15:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Q0mgRg/03MOQpej9BElJrDit39u9W6zvHAyimZvzP78=; b=TJcnfaydc5RWJjg8WtYgR6gAZkfeFs8gCbijkoKzO9wKFxrDiaagbSa/l/GexDfgHQ IwdO7wfVk+TAm8pY28sjG0S4+XjxJEshOC1FhYQRnRA2MFDN4aV6cPduQM8JmCimS+GK VxIenBF0f91I4GbXILVUpQukYavfpmY5W2K5HTQHXxfHVMTARmH/lLbVZirZF6NanrD9 VG2ThMOpKG01tpkYqyKYEOrJLFbQd+/c1b/k0XuE7mDtdPJy8fyEuiFjSWZF2LZ8WpKp MBxVWqeSSUDbj2+gr2Um1Lb7hM0UIqduaCABKxVHbpnMSoD2CGJB9XJ0caj3hDqKqHgM /iAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Q0mgRg/03MOQpej9BElJrDit39u9W6zvHAyimZvzP78=; b=C9YI5y3krgm0e5Gmu6xehFvFps7iShtszUgkTx7ixFWA+2scg/6ucE3bTVAC6mPaDS jLjRGToCZQntNMRa/uP0+dLaHDReiZXOut88iv+bfoAe9yJdO5vjFwtM/ZyEfrZnNTK7 +zMEecVuvZkoo1bpDTx5onOTUnn9zmeaoccBiYQO0UjTXJC11YErsYwqiKbwde8elaLJ CyTmfBBT5tyX+O7Rvs349BF9RRedxl99VVIg4yQOMpBa3R3dVl9aH5IVAikWDVo4Yuma pB/wYps4w2wra1sVJwOH4gPx1qeZ2voLl1sHSTzOV4WCJ6xf3MeXPhb6VNEyDidP1bkK w7Ew== X-Gm-Message-State: AOAM530QNdcOW7/x43IABcfaZ024ke2+XBM+aboT4nJ2TK0fPHO3w0du WXP5wiJdAPkaVBA1FJ43AMV1xii8n3Y= X-Google-Smtp-Source: ABdhPJyKAGRXFGW5cJUbjy8omlx4yBU4XaJLnsJGtwPyBfyV0WJ6erChHEugA3LN2ly+n18ntI9GDA== X-Received: by 2002:adf:fb8d:: with SMTP id a13mr607804wrr.164.1630623264503; Thu, 02 Sep 2021 15:54:24 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id k17sm2825890wmj.0.2021.09.02.15.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 15:54:23 -0700 (PDT) In-Reply-To: <89f53c5f-3936-bfb1-eb47-11c9a6bd8e5c@yandex.ru> (Dmitry Gutov's message of "Tue, 31 Aug 2021 03:00:51 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=orontee@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:273733 Archived-At: --=-=-= Content-Type: text/plain Hi Dmitry, Dmitry Gutov writes: > (...) I just pushed commit d2ad64b which seems to fix > vc-diff-mergebase, as well similar problems that could still remain in > any less frequently used commands, check it out. > > That said, new contributions to vc-tests.el would be quite welcome. > > If there was even one test scenario in there that called > vc-diff-mergebase, we wouldn't have let this bug slip by. I tried to write a test for with vc-version-diff to start with something that looks easier to me. (Almost copy-pasta I'm afraid of.) I installed RCS, CVS, SVN, Git, Bzr. Unfortunately the test fails with the first two; Still no idea why... Since it's the first time I use ERT and before I spend more time investigating, can you confirm it's the kind of test you had in mind? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Extend-vc-tests.patch >From 6fc74be7a410233c0f71651ffdac49adbf82334e Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Fri, 3 Sep 2021 00:42:29 +0200 Subject: [PATCH] Extend vc tests * test/lisp/vc/vc-tests.el (vc-test--version-diff): Test vc-version-diff --- test/lisp/vc/vc-tests.el | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el index f2807a3f06..beb79d1b36 100644 --- a/test/lisp/vc/vc-tests.el +++ b/test/lisp/vc/vc-tests.el @@ -547,6 +547,65 @@ vc-test--checkout-model (if tempdir (delete-directory tempdir t)) (run-hooks 'vc-test--cleanup-hook))))) +(defun vc-test--version-diff (backend) + "Check the diff version of a repository." + + (let ((vc-handled-backends `(,backend)) + (default-directory + (file-name-as-directory + (expand-file-name + (make-temp-name "vc-test") temporary-file-directory))) + (process-environment process-environment) + tempdir + vc-test--cleanup-hook) + (when (eq backend 'Bzr) + (setq tempdir (make-temp-file "vc-test--version-diff" t) + process-environment (cons (format "BZR_HOME=%s" tempdir) + process-environment))) + + (unwind-protect + (progn + ;; Cleanup. + (add-hook + 'vc-test--cleanup-hook + `(lambda () (delete-directory ,default-directory 'recursive))) + + ;; Create empty repository. Check repository checkout model. + (make-directory default-directory) + (vc-test--create-repo-function backend) + + (let* ((tmp-name (expand-file-name "foo" default-directory)) + (files (list (file-name-nondirectory tmp-name)))) + ;; Write and register a new file. + (write-region "originaltext" nil tmp-name nil 'nomessage) + (vc-register (list backend files)) + + ;; Checkin file. + (let ((buff (find-file tmp-name))) + (with-current-buffer buff + (progn + (vc-checkin files backend) + (insert "Testing vc-version-diff") + (log-edit-done)))) + + ;; Modify file content. + (write-region "updatedtext" nil tmp-name nil 'nomessage) + + ;; Check version diff. + (message "vc-version-diff") + (vc-version-diff files nil nil) + (with-current-buffer "*vc-diff*" + (progn + (let ((rawtext (buffer-substring-no-properties (point-min) + (point-max)))) + (should (string-search "-originaltext" rawtext)) + (should (string-search "+updatedtext" rawtext))))))) + + ;; Save exit. + (ignore-errors + (if tempdir (delete-directory tempdir t)) + (run-hooks 'vc-test--cleanup-hook))))) + (defun vc-test--rename-file (backend) "Check the rename-file action." @@ -712,6 +771,18 @@ vc-test--arch-enabled ',(intern (format "vc-test-%s01-register" backend-string)))))) (vc-test--rename-file ',backend)) + + (ert-deftest + ,(intern (format "vc-test-%s06-version-diff" backend-string)) () + ,(format "Check `vc-version-diff' for the %s backend." + backend-string) + (skip-unless + (ert-test-passed-p + (ert-test-most-recent-result + (ert-get-test + ',(intern + (format "vc-test-%s01-register" backend-string)))))) + (vc-test--version-diff ',backend)) )))) (provide 'vc-tests) -- 2.30.2 --=-=-= Content-Type: text/plain -- Matthias --=-=-=--