[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/package+vc 5ceb88e6eb 4/6: Have 'vc-clone' return a directory
From: |
Philip Kaludercic |
Subject: |
feature/package+vc 5ceb88e6eb 4/6: Have 'vc-clone' return a directory |
Date: |
Tue, 18 Oct 2022 16:35:49 -0400 (EDT) |
branch: feature/package+vc
commit 5ceb88e6ebf14cee3f97b0c7b8557e4b1e23de5b
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Have 'vc-clone' return a directory
* lisp/vc/vc-bzr.el (vc-bzr-clone): Return directory.
* lisp/vc/vc-git.el (vc-git-clone): Return directory.
* lisp/vc/vc-hg.el (vc-hg-clone): Return directory.
* lisp/vc/vc-svn.el (vc-svn-clone): Return directory.
* lisp/vc/vc.el (vc-clone): Ensure the backend returns directory.
---
lisp/vc/vc-bzr.el | 3 ++-
lisp/vc/vc-git.el | 3 ++-
lisp/vc/vc-hg.el | 3 ++-
lisp/vc/vc-svn.el | 3 ++-
lisp/vc/vc.el | 20 ++++++++++----------
5 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 307c5fa500..5e826b9a28 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -533,7 +533,8 @@ in the branch repository (or whose status not be
determined)."
(vc-message-unresolved-conflicts buffer-file-name)))
(defun vc-bzr-clone (remote directory)
- (vc-bzr-command nil 0 '() "branch" remote directory))
+ (vc-bzr-command nil 0 '() "branch" remote directory)
+ directory)
(defun vc-bzr-version-dirstate (dir)
"Try to return as a string the bzr revision ID of directory DIR.
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index d63d755a28..366ab9a4f7 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1269,7 +1269,8 @@ This prompts for a branch to merge from."
(vc-message-unresolved-conflicts buffer-file-name)))
(defun vc-git-clone (remote directory)
- (vc-git--out-ok "clone" remote directory))
+ (vc-git--out-ok "clone" remote directory)
+ directory)
;;; HISTORY FUNCTIONS
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index ee54f34201..3ea4c5d32c 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1251,7 +1251,8 @@ REV is the revision to check out into WORKFILE."
(vc-message-unresolved-conflicts buffer-file-name)))
(defun vc-hg-clone (remote directory)
- (vc-hg-command nil 0 '() "clone" remote directory))
+ (vc-hg-command nil 0 '() "clone" remote directory)
+ directory)
;; Modeled after the similar function in vc-bzr.el
(defun vc-hg-revert (file &optional contents-done)
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 1aebf30c2a..ae6884bbae 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -818,7 +818,8 @@ Set file properties accordingly. If FILENAME is non-nil,
return its status."
(buffer-substring-no-properties (point-min) (1- (point-max))))))
(defun vc-svn-clone (remote directory)
- (vc-svn-command nil 0 '() "checkout" remote directory))
+ (vc-svn-command nil 0 '() "checkout" remote directory)
+ (file-name-concat directory "trunk"))
(provide 'vc-svn)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 49bb7a27aa..76b8970b5b 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -588,7 +588,8 @@
;; - clone (remote directory)
;;
;; Attempt to clone a REMOTE repository, into a local DIRECTORY.
-;; Returns the symbol of the backend used if successful.
+;; Returns a string with the directory with the contents of the
+;; repository if successful, otherwise nil.
;;; Changes from the pre-25.1 API:
;;
@@ -3517,24 +3518,23 @@ to provide the `find-revision' operation instead."
(defun vc-clone (backend remote &optional directory)
"Use BACKEND to clone REMOTE into DIRECTORY.
-If successful, returns the symbol of the backed used to clone.
-If BACKEND is nil, iterate through every known backend in
-`vc-handled-backends' until one succeeds."
+If successful, returns the a string with the directory of the
+checkout. If BACKEND is nil, iterate through every known backend
+in `vc-handled-backends' until one succeeds."
(unless directory
(setq directory default-directory))
(if backend
(progn
(unless (memq backend vc-handled-backends)
(error "Unknown VC backend %s" backend))
- (vc-call-backend backend 'clone remote directory)
- backend)
+ (vc-call-backend backend 'clone remote directory))
(catch 'ok
(dolist (backend vc-handled-backends)
(ignore-error vc-not-supported
- (when-let (res (vc-call-backend
- backend 'clone
- remote directory))
- (throw 'ok backend)))))))
+ (when-let ((res (vc-call-backend
+ backend 'clone
+ remote directory)))
+ (throw 'ok res)))))))
- feature/package+vc updated (5134eb02cf -> 5d60ea47f6), Philip Kaludercic, 2022/10/18
- feature/package+vc c25e78d802 3/6: * src/keyboard.c (echo_add_key): Mention quick-help, Philip Kaludercic, 2022/10/18
- feature/package+vc 5ceb88e6eb 4/6: Have 'vc-clone' return a directory,
Philip Kaludercic <=
- feature/package+vc 5d60ea47f6 6/6: Use 'elpa-packages' files for VC metadata, Philip Kaludercic, 2022/10/18
- feature/package+vc 65fa87329c 5/6: Merge remote-tracking branch 'origin/master' into feature/package+vc, Philip Kaludercic, 2022/10/18
- feature/package+vc 39c9b6751e 2/6: Only clone packages if necessary, Philip Kaludercic, 2022/10/18
- feature/package+vc b4e833b2f8 1/6: Attempt to infer the package subject if missing, Philip Kaludercic, 2022/10/18