From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: vc-svn.el vc-svn-diff patch: staying local when possible Date: Thu, 30 Dec 2004 21:53:23 -0800 Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1104472705 28830 80.91.229.6 (31 Dec 2004 05:58:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Dec 2004 05:58:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 31 06:58:19 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CkFnj-0005RG-00 for ; Fri, 31 Dec 2004 06:58:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CkFyX-0004LH-QH for ged-emacs-devel@m.gmane.org; Fri, 31 Dec 2004 01:09:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CkFy1-0004IU-75 for emacs-devel@gnu.org; Fri, 31 Dec 2004 01:08:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CkFxw-0004FS-J6 for emacs-devel@gnu.org; Fri, 31 Dec 2004 01:08:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CkFxw-0004Ee-8P for emacs-devel@gnu.org; Fri, 31 Dec 2004 01:08:48 -0500 Original-Received: from [169.229.60.163] (helo=relay0.EECS.Berkeley.EDU) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CkFjL-0006Hg-Pz; Fri, 31 Dec 2004 00:53:45 -0500 Original-Received: from quack.quarl.org (quack.CS.Berkeley.EDU [128.32.132.234]) by relay0.EECS.Berkeley.EDU (8.13.2/8.12.10) with ESMTP id iBV5rNZ2008943; Thu, 30 Dec 2004 21:53:23 -0800 (PST) Original-Received: by quack.quarl.org (Postfix, from userid 1000) id 8167E1AC34B; Thu, 30 Dec 2004 21:53:23 -0800 (PST) Original-To: Emacs Developement List , Stefan Monnier X-Quack-Archive: 1 X-Payment: hashcash 1.2 1:20:041231:emacs-devel@gnu.org::k65ZBoms+YVvmrWk:0000000000000000000000000000000000000000003Y3f X-Hashcash: 1:20:041231:emacs-devel@gnu.org::k65ZBoms+YVvmrWk:0000000000000000000000000000000000000000003Y3f X-Payment: hashcash 1.2 1:20:041231:monnier@gnu.org::IF/GmxiDGbQcdtAD:00000000000000000000000000000000000000000000000wWB X-Hashcash: 1:20:041231:monnier@gnu.org::IF/GmxiDGbQcdtAD:00000000000000000000000000000000000000000000000wWB X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31634 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31634 Hi, Below is a patch to vc-svn-diff so that doing a vc-diff stays local when possible. Normally, `vc-diff' invokes the back-end diff function with `oldvers' set to (vc-workfile-version file), instead of nil. For whatever reason, "svn diff -r REV file", where REV is the numeric workfile revision, is a remote operation, while "svn diff file" (or "svn diff -r BASE file") is a local operation. The outputs are identical. This patch makes vc-svn-diff call "svn diff file" instead of "svn diff -r REV file" when REV is the workfile version. -- Karl 2004-12-30 21:38 --- vc-svn.el 12 Dec 2004 22:30:40 -0800 1.16 +++ vc-svn.el 30 Dec 2004 21:48:14 -0800 @@ -352,6 +352,8 @@ (defun vc-svn-diff (file &optional oldvers newvers buffer) "Get a difference report using SVN between two versions of FILE." (unless buffer (setq buffer "*vc-diff*")) + (if (and oldvers (equal oldvers (vc-workfile-version file))) + (setq oldvers nil)) (if (string= (vc-workfile-version file) "0") ;; This file is added but not yet committed; there is no master file. (if (or oldvers newvers)