bug-gnu-emacs
[Top][All Lists]
Advanced

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

Bug in ediff-revision


From: Charles Rich
Subject: Bug in ediff-revision
Date: Fri, 17 Jan 2003 14:25:19 -0500

Regarding ediff-revision in ediff.el:

Between Emacs 20.6 and 21.2.1, the definition of
vc-version-other-window (which is eventually called by ediff-revision)
CHANGED from interpreting an empty string for rev1 as the latest
version (which is what the prompt says--see below) to treating it as
the working-version.

Line added below (with comment) restores the "old" behavior, consistent
with the prompt.  

     -CR

P.S. One might consider instead changing the prompt for rev1 below to
read "working version", but from my experience using this command a
lot, the "latest version" behavior is much more useful.


(defun ediff-revision (&optional file startup-hooks)
  "Run Ediff by comparing versions of a file.
The file is an optional FILE argument or the file visited by the current
buffer. Use `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
  ;; if buffer is non-nil, use that buffer instead of the current buffer
  (interactive "P")
  (if (stringp file) (find-file file))
  (let (rev1 rev2)
    (setq rev1
          (read-string
           (format "Version 1 to compare (default: %s's latest version): "
                   (if (stringp file)
                       (file-name-nondirectory file) "current buffer")))
          rev2
          (read-string 
           (format "Version 2 to compare (default: %s): "
                   (if (stringp file)
                       (file-name-nondirectory file) "current buffer"))))
    (ediff-load-version-control)
    ;; fix bug noted above
    (if (string= rev1 "") 
        (setq rev1 (vc-latest-version (buffer-file-name))))
    (funcall
     (intern (format "ediff-%S-internal" ediff-version-control-package))
     rev1 rev2 startup-hooks)
    ))

(defun vc-latest-version (file)
  "Return the version level of the latest version of FILE in repository."
  (or (vc-file-getprop file 'vc-latest-version)
      (cond ((vc-backend file)
             (vc-call state file)
             (vc-file-getprop file 'vc-latest-version))
            (t (error "File %s is not under version control" file)))))

-- 
 Charles Rich, Ph.D. |  Mitsubishi Electric Research Laboratories 
 617-621-7507 phone  |                201 Broadway
 617-621-7550 fax    |            Cambridge, MA 02139
   address@hidden     |            http://www.merl.com





reply via email to

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