GNU bug report logs - #13547
svn annotate - incorrect previous/next revision

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Lars Ljung <lars@HIDDEN>; Keywords: patch; dated Fri, 25 Jan 2013 09:30:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 13547 <at> debbugs.gnu.org:


Received: (at 13547) by debbugs.gnu.org; 30 Jul 2021 11:55:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 30 07:55:06 2021
Received: from localhost ([127.0.0.1]:59188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m9R6Y-0007fZ-H7
	for submit <at> debbugs.gnu.org; Fri, 30 Jul 2021 07:55:06 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41360)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m9R6W-0007ep-NY
 for 13547 <at> debbugs.gnu.org; Fri, 30 Jul 2021 07:55:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=FoOTqNEp+sW88SB8yN7cQfhw6BCnAh0voZlHtLBSaFY=; b=jElAQU/YDCoAh96GYp8vOGwYhP
 2m9Q4q3gJU6qNSRTAsDhmVuRgz2VMoJ5gOmJWbL2eG4EAfoC2PLtE4YbUgygu2XljUF8Nr1y6DfQh
 aU6/Tz8vCX1CoxbCnjU7d02rvgrpcAEkwLOiWGn5QbYGuZ6JbC33SxHltkhTLSRAsJPo=;
Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m9R6M-00074l-N8; Fri, 30 Jul 2021 13:54:57 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Lars Ljung <lars@HIDDEN>
Subject: Re: bug#13547: svn annotate - incorrect previous/next revision
References: <51025067.7070204@HIDDEN> <vgy5ff748s.fsf@HIDDEN>
 <5105105F.9040500@HIDDEN> <878s28kl2e.fsf@HIDDEN>
Date: Fri, 30 Jul 2021 13:54:52 +0200
In-Reply-To: <878s28kl2e.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 15 Jul 2021 11:01:13 +0200")
Message-ID: <87v94snhir.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Lars Ingebrigtsen <larsi@HIDDEN> writes: >>> Thanks. I
 guess
 the drawback here is, that will contact the svn >>> repository, which may
 be on a remote server, so could be slow. >>> >>> It seems this is used by
 vc-annotate, vc-rollback, and vc [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13547
Cc: Glenn Morris <rgm@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 13547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

>>> Thanks. I guess the drawback here is, that will contact the svn
>>> repository, which may be on a remote server, so could be slow.
>>> 
>>> It seems this is used by vc-annotate, vc-rollback, and vc-diff. 
>>
>> Yes, it will be slower. But as far as I know there is no other way to
>> get the previous/next revision of a file.
>
> I haven't used svn in many years, so I don't have much of an opinion
> here.  I've respun the patch for Emacs 28; included below.
>
> Anybody got an opinion here?

I forgot to put Dmitry in the CCs; perhaps he'll have an opinion.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13547; Package emacs. Full text available.

Message received at 13547 <at> debbugs.gnu.org:


Received: (at 13547) by debbugs.gnu.org; 15 Jul 2021 09:01:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 15 05:01:25 2021
Received: from localhost ([127.0.0.1]:46803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m3xFF-0004DX-5J
	for submit <at> debbugs.gnu.org; Thu, 15 Jul 2021 05:01:25 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54824)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m3xFD-00047k-1b
 for 13547 <at> debbugs.gnu.org; Thu, 15 Jul 2021 05:01:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=dOTjjqPeBhX72fkIo6Pl3WjAVhd3D+sOTaj7TJ/wy3k=; b=kLOqSxEyTVLYO2mj+aVR0LX8iX
 NrNve5Cl9Q8BOz1VY6mrYpR3nag27z8X18hdHJCfl//vNPtC84pz7ssWr4Z3zbb9Is2Nb+fLsZNhq
 sxgIWzDfXi1nNhEP+kroj7eCTUk06Vm4GPk2SX4HbbPIVrF/CH2D82Mbd4hepiI7SQVI=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m3xF3-0006Ts-Li; Thu, 15 Jul 2021 11:01:16 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Lars Ljung <lars@HIDDEN>
Subject: Re: bug#13547: svn annotate - incorrect previous/next revision
References: <51025067.7070204@HIDDEN> <vgy5ff748s.fsf@HIDDEN>
 <5105105F.9040500@HIDDEN>
X-Now-Playing: Bob Hund's _KlassiskBOBHUNkonsert_: "Hollywood =?utf-8?Q?n?=
 =?utf-8?Q?=C3=A4sta=22?=
Date: Thu, 15 Jul 2021 11:01:13 +0200
In-Reply-To: <5105105F.9040500@HIDDEN> (Lars Ljung's message of "Sun, 27
 Jan 2013 12:32:47 +0100")
Message-ID: <878s28kl2e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Lars Ljung <lars@HIDDEN> writes: >> Thanks. I guess the
 drawback here is, that will contact the svn >> repository, which may be on
 a remote server, so could be slow. >> >> It seems this is used by vc-annotate, 
 vc-rollback, and vc-dif [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 13547
Cc: Glenn Morris <rgm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 13547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ljung <lars@HIDDEN> writes:

>> Thanks. I guess the drawback here is, that will contact the svn
>> repository, which may be on a remote server, so could be slow.
>> 
>> It seems this is used by vc-annotate, vc-rollback, and vc-diff. 
>
> Yes, it will be slower. But as far as I know there is no other way to
> get the previous/next revision of a file.

I haven't used svn in many years, so I don't have much of an opinion
here.  I've respun the patch for Emacs 28; included below.

Anybody got an opinion here?

diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index c30920dd15..0cc7bda1ba 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -248,23 +248,29 @@ vc-svn-working-revision
 ;; vc-svn-mode-line-string doesn't exist because the default implementation
 ;; works just fine.
 
-(defun vc-svn-previous-revision (_file rev)
-  (let ((newrev (1- (string-to-number rev))))
-    (when (< 0 newrev)
-      (number-to-string newrev))))
+(defun vc-svn-previous-revision (file rev)
+  (if file
+      (with-temp-buffer
+ 	(let (process-file-side-effects)
+ 	  (vc-svn-command t 0 file "log" "-q" "--limit" "2"
+ 			  (format "-r%s:1" rev)))
+ 	(let ((revision-list '()))
+ 	  (while (re-search-backward "^r\\([0-9]+\\)" nil t)
+ 	    (push (match-string 1) revision-list))
+ 	  (cadr revision-list)))
+    (let ((newrev (1- (string-to-number rev))))
+      (when (< 0 newrev)
+ 	(number-to-string newrev)))))
 
 (defun vc-svn-next-revision (file rev)
-  (let ((newrev (1+ (string-to-number rev))))
-    ;; The "working revision" is an uneasy conceptual fit under Subversion;
-    ;; we use it as the upper bound until a better idea comes along.  If the
-    ;; workfile version W coincides with the tree's latest revision R, then
-    ;; this check prevents a "no such revision: R+1" error.  Otherwise, it
-    ;; inhibits showing of W+1 through R, which could be considered anywhere
-    ;; from gracious to impolite.
-    (unless (< (string-to-number (vc-file-getprop file 'vc-working-revision))
-               newrev)
-      (number-to-string newrev))))
-
+  (with-temp-buffer
+    (let (process-file-side-effects)
+      (vc-svn-command t 0 file "log" "-q" "--limit" "2"
+ 		      (format "-r%s:HEAD" rev)))
+    (let ((revision-list '()))
+      (while (re-search-backward "^r\\([0-9]+\\)" nil t)
+ 	(push (match-string 1) revision-list))
+      (cadr revision-list))))
 
 ;;;
 ;;; State-changing functions


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13547; Package emacs. Full text available.
Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 13547 <at> debbugs.gnu.org:


Received: (at 13547) by debbugs.gnu.org; 27 Jan 2013 11:33:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 27 06:33:14 2013
Received: from localhost ([127.0.0.1]:51122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TzQU5-0008Tb-Jm
	for submit <at> debbugs.gnu.org; Sun, 27 Jan 2013 06:33:14 -0500
Received: from mail16.surf-town.net ([212.97.132.56]:53675
	helo=mailgw21.surf-town.net)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <lars@HIDDEN>) id 1TzQU3-0008TT-AU
	for 13547 <at> debbugs.gnu.org; Sun, 27 Jan 2013 06:33:12 -0500
Received: by mailgw21.surf-town.net (Postfix, from userid 65534)
	id 22D32403F; Sun, 27 Jan 2013 12:32:51 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by mailgw21.surf-town.net (Postfix) with ESMTP id 0CBE84068;
	Sun, 27 Jan 2013 12:32:51 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailgw21.surf-town.net
X-Spam-Flag: NO
X-Spam-Score: -1.44
X-Spam-Level: 
X-Spam-Status: No, score=-1.44 tagged_above=-999 required=7
	tests=[ALL_TRUSTED=-1.44] autolearn=disabled
Received: from mailgw21.surf-town.net ([127.0.0.1])
	by localhost (mailgw21.surf-town.net [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id qDMp5D1l+qcw; Sun, 27 Jan 2013 12:32:48 +0100 (CET)
Received: from [192.168.0.101] (c80-216-222-115.bredband.comhem.se
	[80.216.222.115])
	by mailgw21.surf-town.net (Postfix) with ESMTPSA id 972E3403F;
	Sun, 27 Jan 2013 12:32:47 +0100 (CET)
Message-ID: <5105105F.9040500@HIDDEN>
Date: Sun, 27 Jan 2013 12:32:47 +0100
From: Lars Ljung <lars@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version: 1.0
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#13547: svn annotate - incorrect previous/next revision
References: <51025067.7070204@HIDDEN> <vgy5ff748s.fsf@HIDDEN>
In-Reply-To: <vgy5ff748s.fsf@HIDDEN>
X-Enigmail-Version: 1.4.6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13547
Cc: 13547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

2013-01-27 03:24, Glenn Morris skrev:
> Thanks. I guess the drawback here is, that will contact the svn
> repository, which may be on a remote server, so could be slow.
> 
> It seems this is used by vc-annotate, vc-rollback, and vc-diff. 

Yes, it will be slower. But as far as I know there is no other way to
get the previous/next revision of a file.

I suppose the output from an unlimited "svn log" could be saved to speed
up future operations. vc-annotate-warp-revision might actually call
these functions multiple times.

vc-rollback is not supported by the svn backend.

I don'f fully understand how vc-diff works, but these functions are not
called for "C-x v =". This is good since that operation should not
require server access at all.

vc-annotate-show-diff-revision-at-line calls vc-svn-previous-revision.
In that case the server will be contacted twice for no good reason, a
simple "svn diff -r rev" would suffice (isn't this true for all backends?).

vc-annotate-show-changeset-diff-revision-at-line calls
vc-svn-previous-revision with filename set to nil. It that case it makes
sense to return rev-1. The modified patch below takes care of that.

=== modified file 'lisp/vc/vc-svn.el'
*** lisp/vc/vc-svn.el	2013-01-02 16:13:04 +0000
--- lisp/vc/vc-svn.el	2013-01-27 11:04:07 +0000
***************
*** 259,279 ****
  ;; works just fine.

  (defun vc-svn-previous-revision (file rev)
!   (let ((newrev (1- (string-to-number rev))))
!     (when (< 0 newrev)
!       (number-to-string newrev))))

  (defun vc-svn-next-revision (file rev)
!   (let ((newrev (1+ (string-to-number rev))))
!     ;; The "working revision" is an uneasy conceptual fit under
Subversion;
!     ;; we use it as the upper bound until a better idea comes along.
If the
!     ;; workfile version W coincides with the tree's latest revision R,
then
!     ;; this check prevents a "no such revision: R+1" error.  Otherwise, it
!     ;; inhibits showing of W+1 through R, which could be considered
anywhere
!     ;; from gracious to impolite.
!     (unless (< (string-to-number (vc-file-getprop file
'vc-working-revision))
!                newrev)
!       (number-to-string newrev))))


  ;;;
--- 259,286 ----
  ;; works just fine.

  (defun vc-svn-previous-revision (file rev)
!   (if file
!       (with-temp-buffer
! 	(let (process-file-side-effects)
! 	  (vc-svn-command t 0 file "log" "-q" "--limit" "2"
! 			  (format "-r%s:1" rev)))
! 	(let ((revision-list '()))
! 	  (while (re-search-backward "^r\\([0-9]+\\)" nil t)
! 	    (push (match-string 1) revision-list))
! 	  (cadr revision-list)))
!     (let ((newrev (1- (string-to-number rev))))
!       (when (< 0 newrev)
! 	(number-to-string newrev)))))

  (defun vc-svn-next-revision (file rev)
!   (with-temp-buffer
!     (let (process-file-side-effects)
!       (vc-svn-command t 0 file "log" "-q" "--limit" "2"
! 		      (format "-r%s:HEAD" rev)))
!     (let ((revision-list '()))
!       (while (re-search-backward "^r\\([0-9]+\\)" nil t)
! 	(push (match-string 1) revision-list))
!       (cadr revision-list))))


  ;;;






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13547; Package emacs. Full text available.

Message received at 13547 <at> debbugs.gnu.org:


Received: (at 13547) by debbugs.gnu.org; 27 Jan 2013 02:24:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 26 21:24:24 2013
Received: from localhost ([127.0.0.1]:50908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TzHuy-0002kD-GH
	for submit <at> debbugs.gnu.org; Sat, 26 Jan 2013 21:24:24 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:54460)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <rgm@HIDDEN>) id 1TzHuw-0002k5-BW
	for 13547 <at> debbugs.gnu.org; Sat, 26 Jan 2013 21:24:22 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
	(envelope-from <rgm@HIDDEN>)
	id 1TzHue-0001N6-4h; Sat, 26 Jan 2013 21:24:04 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Lars Ljung <lars@HIDDEN>
Subject: Re: bug#13547: svn annotate - incorrect previous/next revision
References: <51025067.7070204@HIDDEN>
X-Spook: anarchy John Kerry subversive CID Plame import Ron Brown
X-Ran: jrH"QS_g)DK;Sf\H^/?i{a|f'x"5#y|(^cGnj!znrS{Jc_g=}DNid"RaY<|V,A|:_AqGt8
X-Hue: green
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Sat, 26 Jan 2013 21:24:03 -0500
In-Reply-To: <51025067.7070204@HIDDEN> (Lars Ljung's message of "Fri, 25
	Jan 2013 10:29:11 +0100")
Message-ID: <vgy5ff748s.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 13547
Cc: 13547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.0 (-----)

Lars Ljung wrote:

> The functions vc-svn-previous-revision and vc-svn-next-revision just add
> or subtract 1 from the revision number. The is usually not correct.
>
> This patch uses "svn log" to get the correct previous/next revision of
> the file.

Thanks. I guess the drawback here is, that will contact the svn
repository, which may be on a remote server, so could be slow.

It seems this is used by vc-annotate, vc-rollback, and vc-diff.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13547; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Jan 2013 09:29:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 25 04:29:50 2013
Received: from localhost ([127.0.0.1]:48642 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tyfba-0001XD-6m
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 04:29:50 -0500
Received: from eggs.gnu.org ([208.118.235.92]:47796)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <lars@HIDDEN>) id 1TyfbX-0001X6-8b
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 04:29:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <lars@HIDDEN>) id 1TyfbI-0002s5-JJ
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 04:29:39 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:36829)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lars@HIDDEN>) id 1TyfbI-0002s1-Gl
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 04:29:32 -0500
Received: from eggs.gnu.org ([208.118.235.92]:59104)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lars@HIDDEN>) id 1TyfbB-0000Zc-E9
	for bug-gnu-emacs@HIDDEN; Fri, 25 Jan 2013 04:29:32 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <lars@HIDDEN>) id 1Tyfb5-0002pn-42
	for bug-gnu-emacs@HIDDEN; Fri, 25 Jan 2013 04:29:25 -0500
Received: from mail2.surf-town.net ([212.97.132.42]:54595
	helo=mailgw14.surf-town.net) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <lars@HIDDEN>) id 1Tyfb4-0002pW-Sj
	for bug-gnu-emacs@HIDDEN; Fri, 25 Jan 2013 04:29:19 -0500
Received: by mailgw14.surf-town.net (Postfix, from userid 65534)
	id CA7EE3E314; Fri, 25 Jan 2013 10:29:16 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by mailgw14.surf-town.net (Postfix) with ESMTP id B3EB33E0BA
	for <bug-gnu-emacs@HIDDEN>; Fri, 25 Jan 2013 10:29:16 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at mailgw14.surf-town.net
Received: from mailgw14.surf-town.net ([127.0.0.1])
	by localhost (mailgw14.surf-town.net [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id Jl6SwPZHHaQO for <bug-gnu-emacs@HIDDEN>;
	Fri, 25 Jan 2013 10:29:13 +0100 (CET)
Received: from [192.168.0.101] (c80-216-222-115.bredband.comhem.se
	[80.216.222.115])
	by mailgw14.surf-town.net (Postfix) with ESMTPSA id CE2033E324
	for <bug-gnu-emacs@HIDDEN>; Fri, 25 Jan 2013 10:29:12 +0100 (CET)
Message-ID: <51025067.7070204@HIDDEN>
Date: Fri, 25 Jan 2013 10:29:11 +0100
From: Lars Ljung <lars@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: svn annotate - incorrect previous/next revision
X-Enigmail-Version: 1.4.6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.3 (----)

Hi,

The functions vc-svn-previous-revision and vc-svn-next-revision just add
or subtract 1 from the revision number. The is usually not correct.

This patch uses "svn log" to get the correct previous/next revision of
the file.

Kind regards,
Lars Ljung

=== modified file 'lisp/vc/vc-svn.el'
*** lisp/vc/vc-svn.el	2013-01-02 16:13:04 +0000
--- lisp/vc/vc-svn.el	2013-01-25 08:26:53 +0000
*************** RESULT is a list of conses (FILE . STATE
*** 259,279 ****
  ;; works just fine.

  (defun vc-svn-previous-revision (file rev)
!   (let ((newrev (1- (string-to-number rev))))
!     (when (< 0 newrev)
!       (number-to-string newrev))))

  (defun vc-svn-next-revision (file rev)
!   (let ((newrev (1+ (string-to-number rev))))
!     ;; The "working revision" is an uneasy conceptual fit under
Subversion;
!     ;; we use it as the upper bound until a better idea comes along.
If the
!     ;; workfile version W coincides with the tree's latest revision R,
then
!     ;; this check prevents a "no such revision: R+1" error.  Otherwise, it
!     ;; inhibits showing of W+1 through R, which could be considered
anywhere
!     ;; from gracious to impolite.
!     (unless (< (string-to-number (vc-file-getprop file
'vc-working-revision))
!                newrev)
!       (number-to-string newrev))))


  ;;;
--- 259,280 ----
  ;; works just fine.

  (defun vc-svn-previous-revision (file rev)
!   (with-temp-buffer
!     (vc-svn-command t 0 file "log" "-q" "--limit" "2"
! 		    (format "-r%s:1" rev))
!     (let ((revision-list '()))
!       (while (re-search-backward "^r\\([0-9]+\\)" nil t)
! 	(setq revision-list (cons (match-string 1) revision-list)))
!       (cadr revision-list))))

  (defun vc-svn-next-revision (file rev)
!   (with-temp-buffer
!     (vc-svn-command t 0 file "log" "-q" "--limit" "2"
! 		    (format "-r%s:HEAD" rev))
!     (let ((revision-list '()))
!       (while (re-search-backward "^r\\([0-9]+\\)" nil t)
! 	(setq revision-list (cons (match-string 1) revision-list)))
!       (cadr revision-list))))


  ;;;





Acknowledgement sent to Lars Ljung <lars@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#13547; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 30 Jul 2021 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.