From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18619: 24.3.93; vc-svn-ignore is broken Date: Fri, 03 Oct 2014 06:02:55 +0400 Message-ID: <86lhoxucz4.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412301871 22598 80.91.229.3 (3 Oct 2014 02:04:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2014 02:04:31 +0000 (UTC) To: 18619@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 03 04:04:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XZsEG-0002g3-O2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Oct 2014 04:04:20 +0200 Original-Received: from localhost ([::1]:37578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsEE-00017a-2C for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Oct 2014 22:04:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsE4-00016U-On for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:04:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZsDy-0002ec-P3 for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:04:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsDy-0002eY-M1 for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XZsDx-00070t-Oo for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Oct 2014 02:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18619 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141230180026908 (code B ref -1); Fri, 03 Oct 2014 02:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Oct 2014 02:03:20 +0000 Original-Received: from localhost ([127.0.0.1]:59606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XZsDI-0006zv-3T for submit@debbugs.gnu.org; Thu, 02 Oct 2014 22:03:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XZsDF-0006zm-ES for submit@debbugs.gnu.org; Thu, 02 Oct 2014 22:03:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZsD9-0002Ap-5G for submit@debbugs.gnu.org; Thu, 02 Oct 2014 22:03:17 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsD9-0002Ad-1d for submit@debbugs.gnu.org; Thu, 02 Oct 2014 22:03:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsD2-00013G-MY for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:03:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZsCw-00025W-La for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:03:04 -0400 Original-Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]:60959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZsCw-000256-Dt for bug-gnu-emacs@gnu.org; Thu, 02 Oct 2014 22:02:58 -0400 Original-Received: by mail-lb0-f173.google.com with SMTP id 10so250046lbg.18 for ; Thu, 02 Oct 2014 19:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=BVprI0P9MnLA1rgSBe2TCINtWd0zACh8UnJDkk+rpqk=; b=E6C1RV9NQ3ZlXLQRtIYXaqr+vL7k2Ei9kRWHLiacyO8qcUBlI+/9q4sbkxKLk28+Rw uyqIO8vTF0RyuBd46tG11bjvabdK0+WOjnPIE69AzW4HPHXPL2q2WVyWKSGM10Q8PfF5 8Hg8rOgqRhjM9m0Vw3dwjrsNC1C3YLoSh3kaEfJc77BzamTjcQFAv7saqHnT4Aui7mrC Hk7jBq4lBLxYSikWr02Or2GK6TQc3RZ6tbBqmiTbO+hEorNDYw3gNC7hhKynIW8JsHMU g/5Ou+UPDmyBVQaIb9Y95fjihRwtYXXti3hrU/PWQRhVWKsRQ0mJspkXKs/VmemaSaPF N2iA== X-Received: by 10.112.180.137 with SMTP id do9mr2125908lbc.63.1412301777145; Thu, 02 Oct 2014 19:02:57 -0700 (PDT) Original-Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id x1sm2158520lag.16.2014.10.02.19.02.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 02 Oct 2014 19:02:56 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94069 Archived-At: Tags: patch It plainly doesn't work: gives an error when called on an unregistered file, or (maybe, haven't tested) succeeds and does nothing when called on a registered file. The way it's currently written is wrong. I don't think there's a way to do "add this file to ignores" in one command invocation. SVN has "propget" and "propset" commands, the value has to be a list of wildcards to ignore, one per line, and it needs to be set on a parent directory, not on the file itself, like the current code tries to do. The attached patch mostly takes care of this. The change to `vc-ignore' is needed because this property doesn't work with absolute paths. And passing a relative path to backend `ignore' implementations make sense anyway. In GNU Emacs 24.3.93.4 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-09-19 on axl Repository revision: 117510 juri@jurta.org-20140918205955-kwp5ckzrk2l4w1km Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS === modified file 'lisp/vc/vc-svn.el' --- lisp/vc/vc-svn.el 2014-01-01 07:43:34 +0000 +++ lisp/vc/vc-svn.el 2014-10-03 01:51:12 +0000 @@ -354,14 +354,22 @@ (concat "-r" rev)) (vc-switches 'SVN 'checkout)))) -(defun vc-svn-ignore (file &optional _directory _remove) +(defun vc-svn-ignore (file &optional directory remove) "Ignore FILE under Subversion. FILE is a file wildcard, relative to the root directory of DIRECTORY." - (vc-svn-command t 0 file "propedit" "svn:ignore")) + (let* ((ignores (vc-svn-ignore-completion-table directory)) + (ignores (if remove + (delete file ignores) + (push file ignores)))) + (vc-svn-command nil 0 nil nil "propset" "svn:ignore" + (mapconcat #'identity ignores "\n") + (expand-file-name directory)))) -(defun vc-svn-ignore-completion-table (_file) - "Return the list of ignored files." - ) +(defun vc-svn-ignore-completion-table (directory) + "Return the list of ignored files in DIRECTORY." + (with-temp-buffer + (vc-svn-command t t nil "propget" "svn:ignore" (expand-file-name directory)) + (split-string (buffer-string)))) (defun vc-svn-find-admin-dir (file) "Return the administrative directory of FILE." === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2014-01-01 07:43:34 +0000 +++ lisp/vc/vc.el 2014-10-03 01:58:18 +0000 @@ -1370,7 +1370,9 @@ (let* ((directory (or directory default-directory)) (backend (or (vc-responsible-backend default-directory) (error "Unknown backend")))) - (vc-call-backend backend 'ignore file directory remove))) + (vc-call-backend backend 'ignore + (file-relative-name file directory) + directory remove))) (defun vc-default-ignore (backend file &optional directory remove) "Ignore FILE under the VCS of DIRECTORY (default is `default-directory').