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-mcvs.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-mcvs.el
Date: Tue, 22 Apr 2003 15:03:18 -0400

Index: emacs/lisp/vc-mcvs.el
diff -c emacs/lisp/vc-mcvs.el:1.1 emacs/lisp/vc-mcvs.el:1.2
*** emacs/lisp/vc-mcvs.el:1.1   Sat Apr 19 20:02:37 2003
--- emacs/lisp/vc-mcvs.el       Tue Apr 22 15:03:18 2003
***************
*** 45,52 ****
  
  ;;; Bugs:
  
- ;; - Both the diff and log output contain Meta-CVS inode names so that
- ;;   several operations in those buffers don't work as advertised.
  ;; - VC-dired doesn't work.
  
  ;;; Code:
--- 45,50 ----
***************
*** 135,146 ****
  
  (defun vc-mcvs-root (file)
    "Return the root directory of a Meta-CVS project, if any."
!   (let ((root nil))
!     (while (not (or root (equal file (setq file (file-name-directory file)))))
!       (if (file-directory-p (expand-file-name "MCVS/CVS" file))
!           (setq root file)
!         (setq file (directory-file-name file))))
!     root))
  
  (defun vc-mcvs-read (file)
    (with-temp-buffer
--- 133,148 ----
  
  (defun vc-mcvs-root (file)
    "Return the root directory of a Meta-CVS project, if any."
!   (or (vc-file-getprop file 'mcvs-root)
!       (vc-file-setprop
!        file 'mcvs-root
!        (let ((root nil))
!        (while (not (or root
!                        (equal file (setq file (file-name-directory file)))))
!          (if (file-directory-p (expand-file-name "MCVS/CVS" file))
!              (setq root file)
!            (setq file (directory-file-name file))))
!        root))))
  
  (defun vc-mcvs-read (file)
    (with-temp-buffer
***************
*** 158,166 ****
    (let (root inode cvsfile)
      (when (and (setq root (vc-mcvs-root file))
               (setq inode (vc-mcvs-map-file
!                           root (substring file (length root)))))
        (vc-file-setprop file 'mcvs-inode inode)
-       (vc-file-setprop file 'mcvs-root root)
        ;; Avoid calling `mcvs diff' in vc-workfile-unchanged-p.
        (vc-file-setprop file 'vc-checkout-time
                       (if (vc-cvs-registered
--- 160,167 ----
    (let (root inode cvsfile)
      (when (and (setq root (vc-mcvs-root file))
               (setq inode (vc-mcvs-map-file
!                           root (file-relative-name file root))))
        (vc-file-setprop file 'mcvs-inode inode)
        ;; Avoid calling `mcvs diff' in vc-workfile-unchanged-p.
        (vc-file-setprop file 'vc-checkout-time
                       (if (vc-cvs-registered
***************
*** 243,249 ****
      ;; belly-up.
      (unless (file-writable-p map-file)
        (vc-checkout map-file t))
!     (unless (file-writable-p types-file)
        (vc-checkout types-file t))
      ;; Make sure the `mcvs add' will not fire up the CVSEDITOR
      ;; to add a rule for the given file's extension.
--- 244,250 ----
      ;; belly-up.
      (unless (file-writable-p map-file)
        (vc-checkout map-file t))
!     (unless (or (file-writable-p types-file) (not (file-exists-p types-file)))
        (vc-checkout types-file t))
      ;; Make sure the `mcvs add' will not fire up the CVSEDITOR
      ;; to add a rule for the given file's extension.
***************
*** 255,261 ****
        (push (list ext (make-symbol (upcase (concat ":" type)))) types)
        (setq types (sort types (lambda (x y) (string< (car x) (car y)))))
        (with-current-buffer (find-file-noselect types-file)
-         (if buffer-read-only (vc-checkout buffer-file-name t))
          (erase-buffer)
          (pp types (current-buffer))
          (save-buffer)
--- 256,261 ----
***************
*** 277,286 ****
        ;; I'm not sure exactly why, but if we don't setup the inode and root
        ;; prop of the file, things break later on in vc-mode-line that
        ;; ends up calling vc-mcvs-workfile-version.
-       (vc-mcvs-registered file)
        ;; We also need to set vc-checkout-time so that vc-workfile-unchanged-p
        ;; doesn't try to call `mcvs diff' on the file.
!       (vc-file-setprop file 'vc-checkout-time 0))))
  
  (defalias 'vc-mcvs-responsible-p 'vc-mcvs-root
    "Return non-nil if CVS thinks it is responsible for FILE.")
--- 277,285 ----
        ;; I'm not sure exactly why, but if we don't setup the inode and root
        ;; prop of the file, things break later on in vc-mode-line that
        ;; ends up calling vc-mcvs-workfile-version.
        ;; We also need to set vc-checkout-time so that vc-workfile-unchanged-p
        ;; doesn't try to call `mcvs diff' on the file.
!       (vc-mcvs-registered file))))
  
  (defalias 'vc-mcvs-responsible-p 'vc-mcvs-root
    "Return non-nil if CVS thinks it is responsible for FILE.")
***************
*** 591,602 ****
    "A wrapper around `vc-do-command' for use in vc-mcvs.el.
  The difference to vc-do-command is that this function always invokes `mcvs',
  and that it passes `vc-mcvs-global-switches' to it before FLAGS."
!   (apply 'vc-do-command buffer okstatus "mcvs" file
!        (append '("--error-continue")
!                (if (stringp vc-mcvs-global-switches)
!                    (cons vc-mcvs-global-switches flags)
!                  (append vc-mcvs-global-switches
!                          flags)))))
  
  (defun vc-mcvs-stay-local-p (file) (vc-mcvs-cvs stay-local-p file))
  
--- 590,611 ----
    "A wrapper around `vc-do-command' for use in vc-mcvs.el.
  The difference to vc-do-command is that this function always invokes `mcvs',
  and that it passes `vc-mcvs-global-switches' to it before FLAGS."
!   (let ((args (append '("--error-continue")
!                     (if (stringp vc-mcvs-global-switches)
!                         (cons vc-mcvs-global-switches flags)
!                       (append vc-mcvs-global-switches
!                               flags)))))
!     (if (member (car flags) '("diff" "log"))
!       ;; We need to filter the output.
!       (vc-do-command buffer okstatus "sh" nil "-c"
!                      (concat "mcvs "
!                              (mapconcat
!                               'shell-quote-argument
!                               (append (remq nil args)
!                                       (if file (list (file-relative-name 
file))))
!                               " ")
!                              " | mcvs filt"))
!       (apply 'vc-do-command buffer okstatus "mcvs" file args))))
  
  (defun vc-mcvs-stay-local-p (file) (vc-mcvs-cvs stay-local-p file))
  




reply via email to

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