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: Sat, 04 Sep 2021 22:24:24 +0200 Message-ID: <87eea49jif.fsf@gmail.com> References: <87a6kyacqn.fsf@gmail.com> <89f53c5f-3936-bfb1-eb47-11c9a6bd8e5c@yandex.ru> <87o89avba8.fsf@gmail.com> <7b6753e7-1bde-4a1c-e0b3-02a63adec84c@yandex.ru> <87r1e49lvx.fsf@gmail.com> 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="2885"; 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 Sat Sep 04 22:25:12 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 1mMcDv-0000bo-Pu for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 22:25:11 +0200 Original-Received: from localhost ([::1]:44422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMcDu-0002tA-Ny for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 16:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMcDE-0002D3-W4 for emacs-devel@gnu.org; Sat, 04 Sep 2021 16:24:29 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMcDD-0003p1-Ac for emacs-devel@gnu.org; Sat, 04 Sep 2021 16:24:28 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id k20-20020a05600c0b5400b002e87ad6956eso1941278wmr.1 for ; Sat, 04 Sep 2021 13:24: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=08k2Qe7BZbZEay2lJf1BD/IW6hfBboaaj0XiUEvERUA=; b=Je4jTMZ1qGN+f5eamysPyxEDJbUo8TU5fyaGNYJ60OloN3z80Y+vV3x9sUEY2dglfl 5AFRXiwFHkCHrER8AfQwzA8JjBP9NUkGtgL23jncTCnfq+L0UHGj4SOU+YmfaREoNWw9 BwNVB+7RSxCLu7RStEWf+Z7K0T61TOasgt9/Wcv2vSFrUDQKjFPorizG7ZbzuJkaUOT/ K08oHiCSb2agHu6IxrcBARbnPJOYhVYoODf64ALtJVBi/NADWO+KEzMOY1OnzP1BGS/m DvJcEsnPK7YkSSc3MRmdtmF/5RlA37rJF0fiYYmfTjD/cuEOSn4E6yhzHrd41KmL6vPN yqcw== 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=08k2Qe7BZbZEay2lJf1BD/IW6hfBboaaj0XiUEvERUA=; b=ONMeuDAtB965WFxZW1Lv2hfd8q2EPovei6nagnFQpnNGDq9UzQOtzyEM7mnl7Sxi4h nzSvLDlEYFGzanF+G2akmByuYdtZbWDa5EAJUynCnvXp2ZkfuTY7sYlELHFIRRSCz4/f vo9CB1MdIxNESxweX9zWEkQtNAVTVT/VPDQ5jB0AEKqOpQ4U0BEq/tVlxj9s9LUOpcuO WNUJ+4RQdGCR5p7RLv/4185S6uRFpIW53v1gdGArN1RJP6jQ0smFr/zZHIofFAO1ZUO6 FWtWs1ePABDT7tlAlGivROCcVNilQPcGR/24eGk1P8LrBy2px1/zXahNGnk1/OcR2qYw dbVg== X-Gm-Message-State: AOAM530RAES9XMe1ovkNyD4AfBG4JpEgBlLYhMmUIFS5Teo0RMHu4/CA zy0RpEiYPxFtqMskuS04oIf+dtD3cBs= X-Google-Smtp-Source: ABdhPJxnt2fcoKB2LAUVwok+ajDovQNuxhK1aAOScdhfmXkJ+HsmImzReOgvtRMVP+Ww8k1b+SPdBA== X-Received: by 2002:a7b:c0c6:: with SMTP id s6mr4395529wmh.161.1630787065544; Sat, 04 Sep 2021 13:24:25 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id o21sm3156526wms.32.2021.09.04.13.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 13:24:25 -0700 (PDT) In-Reply-To: <87r1e49lvx.fsf@gmail.com> (Matthias Meulien's message of "Sat, 04 Sep 2021 21:33:06 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=orontee@gmail.com; helo=mail-wm1-x32e.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:273962 Archived-At: --=-=-= Content-Type: text/plain Matthias Meulien writes: > (...) I'll work on an updated patch fixing RCS/CVS tests. Here it is: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Test-vc-version-diff.patch >From b9f8b097701a78d4e11b1e85699ba8070b98f163 Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Fri, 3 Sep 2021 00:42:29 +0200 Subject: [PATCH] Test vc-version-diff * test/lisp/vc/vc-tests.el (vc-test--version-diff): Test vc-version-diff --- test/lisp/vc/vc-tests.el | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/test/lisp/vc/vc-tests.el b/test/lisp/vc/vc-tests.el index dfe89c519b..f8c843ff50 100644 --- a/test/lisp/vc/vc-tests.el +++ b/test/lisp/vc/vc-tests.el @@ -547,6 +547,72 @@ 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)) + + (let ((buff (find-file tmp-name))) + (with-current-buffer buff + (progn + ;; Optionally checkout file. + (when (or (eq backend 'RCS) (eq backend 'CVS)) + (vc-checkout tmp-name)) + + ;; Checkin file. + (vc-checkin files backend) + (insert "Testing vc-version-diff") + (log-edit-done)))) + + ;; Modify file content. + (when (or (eq backend 'RCS) (eq backend 'CVS)) + (vc-checkout tmp-name)) + (write-region "updatedtext" nil tmp-name nil 'nomessage) + + ;; Check version diff. + (vc-version-diff files nil nil) + (should (bufferp (get-buffer "*vc-diff*"))) + + (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." @@ -715,6 +781,18 @@ vc-test--arch-enabled ;; "Really want to delete ...?" (skip-unless (not (eq 'CVS ',backend))) (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 --=-=-=--