]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-svn-previous-version, vc-svn-next-version): New funcs.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Mon, 6 Feb 2006 15:58:38 +0000 (15:58 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Mon, 6 Feb 2006 15:58:38 +0000 (15:58 +0000)
lisp/ChangeLog
lisp/vc-svn.el

index a074aad691bc36b157369dfb61d06dd4747cfe71..c2d92160448bb662380246b0f20fd12468181ab8 100644 (file)
@@ -1,4 +1,8 @@
-2006-02-06 Lars Hansen <larsh@soem.dk>
+2006-02-06  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * vc-svn.el (vc-svn-previous-version, vc-svn-next-version): New funcs.
+
+2006-02-06  Lars Hansen  <larsh@soem.dk>
 
        * generic-x.el (etc-fstab-generic-mode): Add file system types
        cifs and usbdevfs. Allow special chars in file names.
index 966f5d2c9c93b5e7db1752967bfddd4bf63ea5fe..82942f78358edf72c3025e3ef334203e9b8c5f71 100644 (file)
@@ -176,6 +176,23 @@ This is only meaningful if you don't use the implicit checkout model
          ((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.  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-workfile-version))
+               newrev)
+      (number-to-string newrev))))
+
 
 ;;;
 ;;; State-changing functions