emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vc-svn-{previous,next}-version


From: Thien-Thi Nguyen
Subject: vc-svn-{previous,next}-version
Date: Sun, 05 Feb 2006 22:36:21 +0100

two funcs in the patch below make C-x v g (followed by P or N) work,
for files under the Subversion version control system.  any objections?

thi


___________________________________________________________
diff -B -w -c -r1.24 vc-svn.el
*** vc-svn.el   13 Dec 2005 22:25:24 -0000      1.24
--- vc-svn.el   5 Feb 2006 21:36:41 -0000
***************
*** 176,181 ****
--- 176,194 ----
          ((eq svn-state 'needs-patch) "(patch)")
          ((eq svn-state 'needs-merge) "(merge)"))))
  
+ (defun vc-svn-previous-version (file rev)
+   (let ((newrev (1- (string-to-number rev))))
+     (when (< 0 newrev)
+       (number-to-string newrev))))
+ 
+ (defun vc-svn-next-version (file rev)
+   (let ((newrev (1+ (string-to-number rev))))
+     ;; The "workfile version" is an uneasy conceptual fit under Subversion;
+     ;; we use it as the upper bound until a better idea comes along.
+     (unless (< (string-to-number (vc-file-getprop file 'vc-workfile-version))
+                newrev)
+       (number-to-string newrev))))
+ 
  
  ;;;
  ;;; State-changing functions




reply via email to

[Prev in Thread] Current Thread [Next in Thread]