emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/vc.el


From: Andre Spiegel
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el
Date: Sat, 05 Jan 2002 12:15:20 -0500

Index: emacs/lisp/vc.el
diff -c emacs/lisp/vc.el:1.324 emacs/lisp/vc.el:1.325
*** emacs/lisp/vc.el:1.324      Thu Dec 20 13:47:19 2001
--- emacs/lisp/vc.el    Sat Jan  5 12:15:20 2002
***************
*** 6,12 ****
  ;; Maintainer: Andre Spiegel <address@hidden>
  ;; Keywords: tools
  
! ;; $Id: vc.el,v 1.324 2001/12/20 18:47:19 pj Exp $
  
  ;; This file is part of GNU Emacs.
  
--- 6,12 ----
  ;; Maintainer: Andre Spiegel <address@hidden>
  ;; Keywords: tools
  
! ;; $Id: vc.el,v 1.325 2002/01/05 17:15:20 spiegel Exp $
  
  ;; This file is part of GNU Emacs.
  
***************
*** 365,370 ****
--- 365,374 ----
  ;;   `revert' operations itself, without calling the backend system.  The
  ;;   default implementation always returns nil.
  ;;
+ ;; - previous-version (file rev)
+ ;;
+ ;;   Return the version number that precedes REV for FILE.
+ ;;
  ;; - check-headers ()
  ;;
  ;;   Return non-nil if the current buffer contains any version headers.
***************
*** 689,715 ****
  
  (defun vc-branch-part (rev)
    "Return the branch part of a revision number REV."
!   (substring rev 0 (string-match "\\.[0-9]+\\'" rev)))
  
  (defun vc-minor-part (rev)
    "Return the minor version number of a revision number REV."
    (string-match "[0-9]+\\'" rev)
    (substring rev (match-beginning 0) (match-end 0)))
  
! (defun vc-previous-version (rev)
!   "Guess the version number immediately preceding REV."
    (let ((branch (vc-branch-part rev))
          (minor-num (string-to-number (vc-minor-part rev))))
!     (if (> minor-num 1)
!         ;; version does probably not start a branch or release
!         (concat branch "." (number-to-string (1- minor-num)))
!       (if (vc-trunk-p rev)
!           ;; we are at the beginning of the trunk --
!           ;; don't know anything to return here
!           ""
!         ;; we are at the beginning of a branch --
!         ;; return version of starting point
!         (vc-branch-part branch)))))
  
  ;; File property caching
  
--- 693,724 ----
  
  (defun vc-branch-part (rev)
    "Return the branch part of a revision number REV."
!   (let ((index (string-match "\\.[0-9]+\\'" rev)))
!     (if index
!         (substring rev 0 index))))
  
  (defun vc-minor-part (rev)
    "Return the minor version number of a revision number REV."
    (string-match "[0-9]+\\'" rev)
    (substring rev (match-beginning 0) (match-end 0)))
  
! (defun vc-default-previous-version (backend file rev)
!   "Guess the version number immediately preceding REV for FILE.
! This default implementation works for <major>.<minor>-style version numbers
! as used by RCS and CVS."  
    (let ((branch (vc-branch-part rev))
          (minor-num (string-to-number (vc-minor-part rev))))
!     (when branch
!       (if (> minor-num 1)
!           ;; version does probably not start a branch or release
!           (concat branch "." (number-to-string (1- minor-num)))
!         (if (vc-trunk-p rev)
!             ;; we are at the beginning of the trunk --
!             ;; don't know anything to return here
!             nil
!           ;; we are at the beginning of a branch --
!           ;; return version of starting point
!           (vc-branch-part branch))))))
  
  ;; File property caching
  
***************
*** 1510,1518 ****
      (if (not (yes-or-no-p (format "Steal the lock on %s from %s? "
                                  file-description owner)))
        (error "Steal canceled"))
!     (compose-mail owner (format "Stolen lock on %s" file-description)
!                 nil nil nil nil
!                 (list (list 'vc-finish-steal file rev)))
      (setq default-directory (expand-file-name "~/"))
      (goto-char (point-max))
      (insert
--- 1519,1534 ----
      (if (not (yes-or-no-p (format "Steal the lock on %s from %s? "
                                  file-description owner)))
        (error "Steal canceled"))
!     (message "Stealing lock on %s..." file)
!     (with-vc-properties
!      file
!      (vc-call steal-lock file rev)
!      `((vc-state . edited)))
!     (vc-resynch-buffer file t t)
!     (message "Stealing lock on %s...done" file)
!     ;; Write mail after actually stealing, because if the stealing
!     ;; goes wrong, we don't want to send any mail.
!     (compose-mail owner (format "Stolen lock on %s" file-description))
      (setq default-directory (expand-file-name "~/"))
      (goto-char (point-max))
      (insert
***************
*** 1521,1536 ****
       ".\n")
      (message "Please explain why you stole the lock.  Type C-c C-c when 
done.")))
  
- (defun vc-finish-steal (file version)
-   ;; This is called when the notification has been sent.
-   (message "Stealing lock on %s..." file)
-   (with-vc-properties
-    file
-    (vc-call steal-lock file version)
-    `((vc-state . edited)))
-   (vc-resynch-buffer file t t)
-   (message "Stealing lock on %s...done" file))
- 
  (defun vc-checkin (file &optional rev comment initial-contents)
    "Check in FILE.
  The optional argument REV may be a string specifying the new version
--- 1537,1542 ----
***************
*** 1771,1777 ****
         (setq rel1-default (vc-workfile-version file)))
        ;; if the file is not locked, use last and previous version as default
        (t
!        (setq rel1-default (vc-previous-version (vc-workfile-version file)))
         (if (string= rel1-default "") (setq rel1-default nil))
         (setq rel2-default (vc-workfile-version file))))
       ;; construct argument list
--- 1777,1784 ----
         (setq rel1-default (vc-workfile-version file)))
        ;; if the file is not locked, use last and previous version as default
        (t
!        (setq rel1-default (vc-call previous-version file 
!                                    (vc-workfile-version file)))
         (if (string= rel1-default "") (setq rel1-default nil))
         (setq rel2-default (vc-workfile-version file))))
       ;; construct argument list



reply via email to

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