emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog vc.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog vc.el
Date: Thu, 27 Aug 2009 16:53:10 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/08/27 16:53:09

Modified files:
        lisp           : ChangeLog vc.el 

Log message:
        (vc-read-revision): New function.
        (vc-version-diff, vc-merge): Use it.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16028&r2=1.16029
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc.el?cvsroot=emacs&r1=1.726&r2=1.727

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16028
retrieving revision 1.16029
diff -u -b -r1.16028 -r1.16029
--- ChangeLog   27 Aug 2009 14:56:17 -0000      1.16028
+++ ChangeLog   27 Aug 2009 16:53:04 -0000      1.16029
@@ -1,3 +1,8 @@
+2009-08-27  Stefan Monnier  <address@hidden>
+
+       * vc.el (vc-read-revision): New function.
+       (vc-version-diff, vc-merge): Use it.
+
 2009-08-27  Sam Steingold  <address@hidden>
 
        * simple.el (kill-do-not-save-duplicates): New user option.
@@ -9,8 +14,8 @@
        * net/tramp.el (tramp-handle-process-file): Do not flush all
        caches when `process-file-side-effects' is set.
        (tramp-handle-vc-registered): Use `tramp-get-file-exists-command'
-       instead of `tramp-find-file-exists-command'.  Unset
-       `process-file-side-effects'.
+       instead of `tramp-find-file-exists-command'.
+       Unset `process-file-side-effects'.
 
 2009-08-27  Michael Albinus  <address@hidden>
 
@@ -30,8 +35,7 @@
        (tramp-get-ls-command, tramp-get-test-command)
        (tramp-get-file-exists-command, tramp-get-remote-ln)
        (tramp-get-remote-perl, tramp-get-remote-stat)
-       (tramp-get-remote-id): Remove
-       superfluous `with-current-buffer'.
+       (tramp-get-remote-id): Remove superfluous `with-current-buffer'.
 
        * net/tramp-cache.el (top): Autoload `tramp-time-less-p'.
        (tramp-cache-inhibit-cache): Extend doc string.  It allows also

Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.726
retrieving revision 1.727
diff -u -b -r1.726 -r1.727
--- vc.el       26 Aug 2009 17:54:10 -0000      1.726
+++ vc.el       27 Aug 2009 16:53:09 -0000      1.727
@@ -1515,6 +1515,20 @@
       ;; because we don't know that yet.
       t)))
 
+(defun vc-read-revision (prompt &optional files backend default initial-input)
+  (cond
+   ((null files)
+    (let ((vc-fileset (vc-deduce-fileset t))) ;FIXME: why t?  --Stef
+      (setq files (cadr vc-fileset))
+      (setq backend (car vc-fileset))))
+   ((null backend) (setq backend (vc-backend (car files)))))
+  (let ((completion-table
+         (vc-call-backend backend 'revision-completion-table files)))
+    (if completion-table
+        (completing-read prompt completion-table
+                         nil nil initial-input nil default)
+      (read-string prompt initial-input nil default))))
+
 ;;;###autoload
 (defun vc-version-diff (files rev1 rev2)
   "Report diffs between revisions of the fileset in the repository history."
@@ -1523,8 +1537,6 @@
          (files (cadr vc-fileset))
           (backend (car vc-fileset))
          (first (car files))
-         (completion-table
-          (vc-call-backend backend 'revision-completion-table files))
          (rev1-default nil)
          (rev2-default nil))
      (cond
@@ -1551,14 +1563,8 @@
                           "Older revision: "))
            (rev2-prompt (concat "Newer revision (default "
                                 (or rev2-default "current source") "): "))
-           (rev1 (if completion-table
-                     (completing-read rev1-prompt completion-table
-                                      nil nil nil nil rev1-default)
-                   (read-string rev1-prompt nil nil rev1-default)))
-           (rev2 (if completion-table
-                     (completing-read rev2-prompt completion-table
-                                      nil nil nil nil rev2-default)
-                   (read-string rev2-prompt nil nil rev2-default))))
+           (rev1 (vc-read-revision rev1-prompt files backend rev1-default))
+           (rev2 (vc-read-revision rev2-prompt files backend rev2-default)))
        (when (string= rev1 "") (setq rev1 nil))
        (when (string= rev2 "") (setq rev2 nil))
        (list files rev1 rev2))))
@@ -1598,13 +1604,9 @@
   (interactive
    (save-current-buffer
      (vc-ensure-vc-buffer)
-     (let ((completion-table
-            (vc-call revision-completion-table (list buffer-file-name)))
-           (prompt "Revision to visit (default is working revision): "))
        (list
-        (if completion-table
-            (completing-read prompt completion-table)
-          (read-string prompt))))))
+      (vc-read-revision "Revision to visit (default is working revision): "
+                        (list buffer-file-name)))))
   (vc-ensure-vc-buffer)
   (let* ((file buffer-file-name)
         (revision (if (string-equal rev "")
@@ -1730,15 +1732,21 @@
          (vc-checkout file t)
        (error "Merge aborted"))))
     (setq first-revision
-         (read-string (concat "Branch or revision to merge from "
-                              "(default news on current branch): ")))
+         (vc-read-revision
+           (concat "Branch or revision to merge from "
+                   "(default news on current branch): ")
+           (list file)
+           backend))
     (if (string= first-revision "")
         (setq status (vc-call-backend backend 'merge-news file))
       (if (not (vc-find-backend-function backend 'merge))
          (error "Sorry, merging is not implemented for %s" backend)
        (if (not (vc-branch-p first-revision))
            (setq second-revision
-                 (read-string "Second revision: "
+                 (vc-read-revision
+                   "Second revision: "
+                   (list file) backend nil
+                   ;; FIXME: This is CVS/RCS/SCCS specific.
                               (concat (vc-branch-part first-revision) ".")))
          ;; We want to merge an entire branch.  Set revisions
          ;; accordingly, so that vc-BACKEND-merge understands us.




reply via email to

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