summaryrefslogtreecommitdiff
path: root/lisp/vc/vc.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-10-23 18:04:55 +0200
committerPhilip Kaludercic <philipk@posteo.net>2022-10-23 18:04:55 +0200
commit2154219059a21d6aad2e7e390187d78029fff3d0 (patch)
tree81573032a66e7f9cd941a22389ecd5d1f5d638b8 /lisp/vc/vc.el
parenta0532e148cca6fc9ede11fda2c9dda20cac4eca5 (diff)
downloademacs-2154219059a21d6aad2e7e390187d78029fff3d0.tar.gz
Immediately check out the right branch or revision
* lisp/emacs-lisp/package-vc.el (package-vc-unpack) Use REV to avoid checking out the wrong branch/revision first. * lisp/vc/vc-bzr.el: Handle REV. * lisp/vc/vc-git.el: Handle REV. * lisp/vc/vc-hg.el: Handle REV. * lisp/vc/vc-svn.el: Handle REV. * lisp/vc/vc.el: Make BACKEND optional and add REV.
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r--lisp/vc/vc.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 7f603093e11..a0a3ce2e6fd 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -3560,24 +3560,25 @@ to provide the `find-revision' operation instead."
(interactive)
(vc-call-backend (vc-backend buffer-file-name) 'check-headers))
-(defun vc-clone (backend remote &optional directory)
+(defun vc-clone (remote &optional backend directory rev)
"Use BACKEND to clone REMOTE into DIRECTORY.
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."
+in `vc-handled-backends' until one succeeds. If REV is non-nil,
+it indicates a specific revision to check out."
(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))
+ (vc-call-backend backend 'clone remote directory rev))
(catch 'ok
(dolist (backend vc-handled-backends)
(ignore-error vc-not-supported
(when-let ((res (vc-call-backend
backend 'clone
- remote directory)))
+ remote directory rev)))
(throw 'ok res)))))))