From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#4179: vc-merge with svn: syntax error in revision arg. Date: Sun, 29 Aug 2021 03:50:04 +0300 Message-ID: <7f7b777c-1ae1-8ca7-bc5c-80f19baba0e6@yandex.ru> References: <87my5ycpj3.fsf@urmel.duenenhof-wilhelm.de> <200908200259.n7K2x8sj004573@godzilla.ics.uci.edu> <200908261804.n7QI4vh7023115@godzilla.ics.uci.edu> <878s0nsi0l.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40047"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: Dieter Wilhelm , Stefan Monnier , 4179@debbugs.gnu.org To: Lars Ingebrigtsen , Dan Nicolaescu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 29 02:51:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mK92b-000A8L-FQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Aug 2021 02:51:17 +0200 Original-Received: from localhost ([::1]:52682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mK92a-0003O3-4C for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 20:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK92M-0003Nq-C3 for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mK92M-0005Gk-43 for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mK92M-0006LI-13 for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Aug 2021 00:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 4179-submit@debbugs.gnu.org id=B4179.163019821524301 (code B ref 4179); Sun, 29 Aug 2021 00:51:01 +0000 Original-Received: (at 4179) by debbugs.gnu.org; 29 Aug 2021 00:50:15 +0000 Original-Received: from localhost ([127.0.0.1]:55179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK91a-0006Jt-PU for submit@debbugs.gnu.org; Sat, 28 Aug 2021 20:50:15 -0400 Original-Received: from mail-wr1-f46.google.com ([209.85.221.46]:36757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK91Y-0006JZ-IQ for 4179@debbugs.gnu.org; Sat, 28 Aug 2021 20:50:13 -0400 Original-Received: by mail-wr1-f46.google.com with SMTP id q14so16625598wrp.3 for <4179@debbugs.gnu.org>; Sat, 28 Aug 2021 17:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jGZO8r2AGGtY9OSWCwBLR5UrTmlssQvrwtdaIPDCmCw=; b=UEe5/akWFplqOyKxeFaYpWoqNwUWV6JBjX2Z+iU79k/AoT5eQ/hQDvEkzLXMdXkLX8 Rczhb4fxxWM02ZzMSjbGTi5krOMdBit73A7rhxMp2DYD6Vyiyhd64Z2GCvdGqr/2NToK setnTKQQrn4uQfyLYwxZSsqNpc1VpaGbUtcTIlcEoQvmYAwIns76RSR5F6vD6sbeRxjM YQym4EConmKDAOleOyO9OEAw++OU3SgKuKLMkvwQkee1Y+JRdpi0L7sJfscPMuA2c86I 2Skux68LHTWSjHrgl4tMWNmsGW4Ujw+1KkvxolOkBlKorRolEW7cZMDPfjdG9L/GURxU miYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jGZO8r2AGGtY9OSWCwBLR5UrTmlssQvrwtdaIPDCmCw=; b=aYAw2MqzPUIORgiGVgrF5GLFASPyKdQ2Tn+mnfv6ZglkS6A2D+VxwieqbD76RVsGXN smh1hNNWHxLEuV7ledWOWbtC82kdCOP5tZtQqtMTNXfv7eHWHZAPwu850UlLKva7WCh7 Fv6FnWriPQk8E9iSLkv6oQEGgDyzsp61tpAv3t+eU4nLwDUK6G+xFnhJIW5GTMt9HLaC ZnnagwZ+yFa0iODhOfUH4nva9s+ma6KO3QPQUl7dxgwycQ/ovReieGvlJentV7WHr/K/ aU9wWlvVPmS+Fdj/M+zrcqd+gfrgkgQ9GZB4xZZopJQu/H/13kFmQl5h90IfSOu3ncwx 0Crw== X-Gm-Message-State: AOAM530V00kZiAppEpd7COaqYsL6BqJWdYekZIxlBC+TVwJx9oEPNvin vmHWEX+YW/an7ANA71DqG74= X-Google-Smtp-Source: ABdhPJwtuwScO197A/Kss9N2vOrN760agDpeVwuNxnh2KTtbiIdO7wAvDsIG0H2G7J4U4yUNgWAqtg== X-Received: by 2002:adf:bad4:: with SMTP id w20mr18286382wrg.100.1630198206680; Sat, 28 Aug 2021 17:50:06 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id z14sm2846106wmi.24.2021.08.28.17.50.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Aug 2021 17:50:06 -0700 (PDT) In-Reply-To: <878s0nsi0l.fsf@gnus.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212905 Archived-At: On 27.08.2021 06:06, Lars Ingebrigtsen wrote: > Dan Nicolaescu writes: > >> We have this code in `vc-merge' >> >> (if (string= first-revision "") >> (setq status (vc-call-backend backend 'merge-news file)) >> (if (not (vc-find-backend-function backend 'merge)) >> (error "Sorry, merging is not implemented for %s" backend) >> (if (not (vc-branch-p first-revision)) >> (setq second-revision >> (read-string "Second revision: " >> (concat (vc-branch-part first-revision) "."))) >> ;; We want to merge an entire branch. Set revisions >> ;; accordingly, so that vc-BACKEND-merge understands us. >> (setq second-revision first-revision) >> ;; first-revision must be the starting point of the branch >> (setq first-revision (vc-branch-part first-revision))) >> >> `vc-branch-p' can be made VC backend specific. >> But what should we do with `vc-branch-part'? >> What should be the new structure of this code? > > (I'm going through old bug reports that unfortunately weren't > resolved at the time.) > > This code has changed a lot in the 12 years since this was discussed -- > does anybody know whether the originally reported problem has been fixed > or not? Hard for me to say: it's SVN. Someone who has easy access to such a server should try the original scenario. But there have indeed been some changes, including commit d17bae903902. Which mentions fixing "a layering violation that caused bad behavior with SVN". > Also: > > ;; functions that operate on RCS revision numbers. This code should > ;; also be moved into the backends. It stays for now, however, since > ;; it is used in code below. > (defun vc-branch-p (rev) > "Return t if REV is a branch revision." > (not (eq nil (string-match "\\`[0-9]+\\(\\.[0-9]+\\.[0-9]+\\)*\\'" rev)))) > > ;;;###autoload > (defun vc-branch-part (rev) > "Return the branch part of a revision number REV." > (let ((index (string-match "\\.[0-9]+\\'" rev))) > (when index > (substring rev 0 index)))) > > The comment there is wrong -- it's no longer used in vc.el. Perhaps > these two functions should be moved to vc-rcs.el (and renamed (with > obsolete aliases))? (They're only used in vc-rcs.el and vc-vcs.el.) Yes, they should. Also, vc-merge should call (vc-find-backend-function backend 'merge-file) instead of (vc-find-backend-function backend 'merge). They only seem equivalent for now by lucky accident. I'd do that change myself now, but it's similarly hard for me to quickly test any of the affected backends, and this operation is not covered by vc-tests.el.