emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100554: Improve VC create/retrieve t


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100554: Improve VC create/retrieve tag/branch.
Date: Wed, 09 Jun 2010 00:47:14 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100554
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Wed 2010-06-09 00:47:14 -0700
message:
  Improve VC create/retrieve tag/branch.
  * lisp/vc.el (vc-create-tag): Do not read the directory name for VCs
  with repository revision granularity.  Adjust the tag/branch
  prompt.  Reset VC properties.
  (vc-retrieve-tag): Do not read the directory name for VCs
  with repository revision granularity.  Reset VC properties.
modified:
  lisp/ChangeLog
  lisp/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-06-09 07:36:45 +0000
+++ b/lisp/ChangeLog    2010-06-09 07:47:14 +0000
@@ -1,3 +1,12 @@
+2010-06-09  Dan Nicolaescu  <address@hidden>
+
+       Improve VC create/retrieve tag/branch.
+       * vc.el (vc-create-tag): Do not read the directory name for VCs
+       with repository revision granularity.  Adjust the tag/branch
+       prompt.  Reset VC properties.
+       (vc-retrieve-tag): Do not read the directory name for VCs
+       with repository revision granularity.  Reset VC properties.
+
 2010-06-09  Julien Danjou  <address@hidden>
 
        * net/notifications.el: New file.

=== modified file 'lisp/vc.el'
--- a/lisp/vc.el        2010-06-01 09:37:49 +0000
+++ b/lisp/vc.el        2010-06-09 07:47:14 +0000
@@ -580,9 +580,6 @@
 ;;   display the branch name in the mode-line. Replace
 ;;   vc-cvs-sticky-tag with that.
 ;;
-;; - vc-create-tag and vc-retrieve-tag should update the
-;;   buffers that might be visiting the affected files.
-;;
 ;;;; Internal cleanups:
 ;;
 ;; - backends that care about vc-stay-local should try to take it into
@@ -1896,14 +1893,22 @@
 given, the tag is made as a new branch and the files are
 checked out in that new branch."
   (interactive
-   (list (read-file-name "Directory: " default-directory default-directory t)
-         (read-string "New tag name: ")
-        current-prefix-arg))
+   (let ((granularity
+         (vc-call-backend (vc-responsible-backend default-directory)
+                          'revision-granularity)))
+     (list
+      (if (eq granularity 'repository)
+         ;; For VC's that do not work at file level, it's pointless
+         ;; to ask for a directory, branches are created at repository level.
+         default-directory
+       (read-file-name "Directory: " default-directory default-directory t))
+      (read-string (if current-prefix-arg "New branch name: " "New tag name: 
"))
+      current-prefix-arg)))
   (message "Making %s... " (if branchp "branch" "tag"))
   (when (file-directory-p dir) (setq dir (file-name-as-directory dir)))
   (vc-call-backend (vc-responsible-backend dir)
                   'create-tag dir name branchp)
-  (vc-resynch-buffer dir t t)
+  (vc-resynch-buffer dir t t t)
   (message "Making %s... done" (if branchp "branch" "tag")))
 
 ;;;###autoload
@@ -1914,8 +1919,16 @@
 locked files at or below DIR (but if NAME is empty, locked files are
 allowed and simply skipped)."
   (interactive
-   (list (read-file-name "Directory: " default-directory default-directory t)
-         (read-string "Tag name to retrieve (default latest revisions): ")))
+   (let ((granularity
+         (vc-call-backend (vc-responsible-backend default-directory)
+                          'revision-granularity)))
+     (list
+      (if (eq granularity 'repository)
+         ;; For VC's that do not work at file level, it's pointless
+         ;; to ask for a directory, branches are created at repository level.
+         default-directory
+       (read-file-name "Directory: " default-directory default-directory t))
+      (read-string "Tag name to retrieve (default latest revisions): "))))
   (let ((update (yes-or-no-p "Update any affected buffers? "))
        (msg (if (or (not name) (string= name ""))
                 (format "Updating %s... " (abbreviate-file-name dir))
@@ -1924,9 +1937,10 @@
     (message "%s" msg)
     (vc-call-backend (vc-responsible-backend dir)
                     'retrieve-tag dir name update)
-    (vc-resynch-buffer dir t t)
+    (vc-resynch-buffer dir t t t)
     (message "%s" (concat msg "done"))))
 
+
 ;; Miscellaneous other entry points
 
 ;; FIXME: this should be a defcustom


reply via email to

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