diff options
| author | Dan Nicolaescu | 2010-06-09 00:47:14 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-06-09 00:47:14 -0700 |
| commit | 5f4f2ae4f967a5a135b95e135c8b29de43ec71b2 (patch) | |
| tree | 675c21ebc54844b9629775165db44785d966549f | |
| parent | ef33fd3404424b34b37a920f10d2ec8008247ef0 (diff) | |
| download | emacs-5f4f2ae4f967a5a135b95e135c8b29de43ec71b2.tar.gz emacs-5f4f2ae4f967a5a135b95e135c8b29de43ec71b2.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/vc.el | 34 |
2 files changed, 33 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39a70fc387f..7a47b2f3586 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-06-09 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Improve VC create/retrieve tag/branch. | ||
| 4 | * vc.el (vc-create-tag): Do not read the directory name for VCs | ||
| 5 | with repository revision granularity. Adjust the tag/branch | ||
| 6 | prompt. Reset VC properties. | ||
| 7 | (vc-retrieve-tag): Do not read the directory name for VCs | ||
| 8 | with repository revision granularity. Reset VC properties. | ||
| 9 | |||
| 1 | 2010-06-09 Julien Danjou <julien@danjou.info> | 10 | 2010-06-09 Julien Danjou <julien@danjou.info> |
| 2 | 11 | ||
| 3 | * net/notifications.el: New file. | 12 | * net/notifications.el: New file. |
diff --git a/lisp/vc.el b/lisp/vc.el index 3d991a21a61..1e52a3ca66f 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -580,9 +580,6 @@ | |||
| 580 | ;; display the branch name in the mode-line. Replace | 580 | ;; display the branch name in the mode-line. Replace |
| 581 | ;; vc-cvs-sticky-tag with that. | 581 | ;; vc-cvs-sticky-tag with that. |
| 582 | ;; | 582 | ;; |
| 583 | ;; - vc-create-tag and vc-retrieve-tag should update the | ||
| 584 | ;; buffers that might be visiting the affected files. | ||
| 585 | ;; | ||
| 586 | ;;;; Internal cleanups: | 583 | ;;;; Internal cleanups: |
| 587 | ;; | 584 | ;; |
| 588 | ;; - backends that care about vc-stay-local should try to take it into | 585 | ;; - backends that care about vc-stay-local should try to take it into |
| @@ -1896,14 +1893,22 @@ the named configuration. If the prefix argument BRANCHP is | |||
| 1896 | given, the tag is made as a new branch and the files are | 1893 | given, the tag is made as a new branch and the files are |
| 1897 | checked out in that new branch." | 1894 | checked out in that new branch." |
| 1898 | (interactive | 1895 | (interactive |
| 1899 | (list (read-file-name "Directory: " default-directory default-directory t) | 1896 | (let ((granularity |
| 1900 | (read-string "New tag name: ") | 1897 | (vc-call-backend (vc-responsible-backend default-directory) |
| 1901 | current-prefix-arg)) | 1898 | 'revision-granularity))) |
| 1899 | (list | ||
| 1900 | (if (eq granularity 'repository) | ||
| 1901 | ;; For VC's that do not work at file level, it's pointless | ||
| 1902 | ;; to ask for a directory, branches are created at repository level. | ||
| 1903 | default-directory | ||
| 1904 | (read-file-name "Directory: " default-directory default-directory t)) | ||
| 1905 | (read-string (if current-prefix-arg "New branch name: " "New tag name: ")) | ||
| 1906 | current-prefix-arg))) | ||
| 1902 | (message "Making %s... " (if branchp "branch" "tag")) | 1907 | (message "Making %s... " (if branchp "branch" "tag")) |
| 1903 | (when (file-directory-p dir) (setq dir (file-name-as-directory dir))) | 1908 | (when (file-directory-p dir) (setq dir (file-name-as-directory dir))) |
| 1904 | (vc-call-backend (vc-responsible-backend dir) | 1909 | (vc-call-backend (vc-responsible-backend dir) |
| 1905 | 'create-tag dir name branchp) | 1910 | 'create-tag dir name branchp) |
| 1906 | (vc-resynch-buffer dir t t) | 1911 | (vc-resynch-buffer dir t t t) |
| 1907 | (message "Making %s... done" (if branchp "branch" "tag"))) | 1912 | (message "Making %s... done" (if branchp "branch" "tag"))) |
| 1908 | 1913 | ||
| 1909 | ;;;###autoload | 1914 | ;;;###autoload |
| @@ -1914,8 +1919,16 @@ If locking is used for the files in DIR, then there must not be any | |||
| 1914 | locked files at or below DIR (but if NAME is empty, locked files are | 1919 | locked files at or below DIR (but if NAME is empty, locked files are |
| 1915 | allowed and simply skipped)." | 1920 | allowed and simply skipped)." |
| 1916 | (interactive | 1921 | (interactive |
| 1917 | (list (read-file-name "Directory: " default-directory default-directory t) | 1922 | (let ((granularity |
| 1918 | (read-string "Tag name to retrieve (default latest revisions): "))) | 1923 | (vc-call-backend (vc-responsible-backend default-directory) |
| 1924 | 'revision-granularity))) | ||
| 1925 | (list | ||
| 1926 | (if (eq granularity 'repository) | ||
| 1927 | ;; For VC's that do not work at file level, it's pointless | ||
| 1928 | ;; to ask for a directory, branches are created at repository level. | ||
| 1929 | default-directory | ||
| 1930 | (read-file-name "Directory: " default-directory default-directory t)) | ||
| 1931 | (read-string "Tag name to retrieve (default latest revisions): ")))) | ||
| 1919 | (let ((update (yes-or-no-p "Update any affected buffers? ")) | 1932 | (let ((update (yes-or-no-p "Update any affected buffers? ")) |
| 1920 | (msg (if (or (not name) (string= name "")) | 1933 | (msg (if (or (not name) (string= name "")) |
| 1921 | (format "Updating %s... " (abbreviate-file-name dir)) | 1934 | (format "Updating %s... " (abbreviate-file-name dir)) |
| @@ -1924,9 +1937,10 @@ allowed and simply skipped)." | |||
| 1924 | (message "%s" msg) | 1937 | (message "%s" msg) |
| 1925 | (vc-call-backend (vc-responsible-backend dir) | 1938 | (vc-call-backend (vc-responsible-backend dir) |
| 1926 | 'retrieve-tag dir name update) | 1939 | 'retrieve-tag dir name update) |
| 1927 | (vc-resynch-buffer dir t t) | 1940 | (vc-resynch-buffer dir t t t) |
| 1928 | (message "%s" (concat msg "done")))) | 1941 | (message "%s" (concat msg "done")))) |
| 1929 | 1942 | ||
| 1943 | |||
| 1930 | ;; Miscellaneous other entry points | 1944 | ;; Miscellaneous other entry points |
| 1931 | 1945 | ||
| 1932 | ;; FIXME: this should be a defcustom | 1946 | ;; FIXME: this should be a defcustom |