]> git.eshelyaron.com Git - emacs.git/commitdiff
Have 'vc-clone' return a directory
authorPhilip Kaludercic <philipk@posteo.net>
Tue, 18 Oct 2022 19:21:49 +0000 (21:21 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Tue, 18 Oct 2022 19:21:49 +0000 (21:21 +0200)
* 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
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc-svn.el
lisp/vc/vc.el

index 307c5fa500ddb20c09707a5f6912d2e37250fb6f..5e826b9a2865f0e799b3bbe97294ffcfc6c88258 100644 (file)
@@ -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.
index d63d755a287e3ccdf071bb30665654945c99f5b6..366ab9a4f7a568b2dcd079ab93bd8b28444f97b5 100644 (file)
@@ -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
 
index ee54f34201ca46d24640901da66eabc6c68401ea..3ea4c5d32cd86d794ef3d0a37c7c816758508b9f 100644 (file)
@@ -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)
index 1aebf30c2a3d0d0f1b5e003e24b5549a38a0e6f9..ae6884bbaeafec9c70857a990b38150a85142b2d 100644 (file)
@@ -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)
 
index 49bb7a27aad59f5d80ac6219a30197dc484cb61f..76b8970b5b4b86280c381008479a06415bec0a35 100644 (file)
 ;; - 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)))))))
 
 \f