summaryrefslogtreecommitdiff
path: root/lisp/vc/vc.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2015-05-12 20:42:42 -0400
committerGlenn Morris <rgm@gnu.org>2015-05-12 20:42:42 -0400
commit660c30cc8cec13cf0c2177c62f3c1acc23b04f7d (patch)
treec52894955910c4a0a7600e5b9639348aa97191fe /lisp/vc/vc.el
parentf9ba8dc074bf34d2b3d88df69ed19e9141368b81 (diff)
downloademacs-660c30cc8cec13cf0c2177c62f3c1acc23b04f7d.tar.gz
Add basic VC push support.
* lisp/vc/vc.el (vc-push): New autoloaded command. * lisp/vc/vc-hooks.el (vc-prefix-map, vc-menu-map): Add vc-push. * lisp/vc/vc-bzr.el (vc-bzr--pushpull): New, factored from vc-bzr-pull. (vc-bzr-pull): Reimplement using vc-bzr--pushpull. (vc-bzr-push): New. * lisp/vc/vc-git.el (vc-git--pushpull): New, factored from vc-git-pull. (vc-git-pull): Reimplement using vc-git--pushpull. (vc-git-push): New. * lisp/vc/vc-hg.el (vc-hg--pushpull): New, factored from vc-hg-pull. (vc-hg-pull, vc-hg-push): Reimplement using vc-hg--pushpull. * doc/emacs/maintaining.texi (Pulling / Pushing): Rename from "VC Pull". Mention pushing. (VC With A Merging VCS, VC Change Log): Update xrefs. (Branches): Update menu. * doc/emacs/emacs.texi: Update menu. * etc/NEWS: Mention this.
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r--lisp/vc/vc.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 1a997a4d183..d5d0abe6517 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2484,6 +2484,22 @@ tip revision are merged into the working file."
;;;###autoload
(defalias 'vc-update 'vc-pull)
+;;;###autoload
+(defun vc-push (&optional arg)
+ "Push the current branch.
+You must be visiting a version controlled file, or in a `vc-dir' buffer.
+On a distributed version control system, this runs a \"push\"
+operation on the current branch, prompting for the precise command
+if required. Optional prefix ARG non-nil forces a prompt.
+On a non-distributed version control system, this signals an error."
+ (interactive "P")
+ (let* ((vc-fileset (vc-deduce-fileset t))
+ (backend (car vc-fileset)))
+;;; (files (cadr vc-fileset)))
+ (if (vc-find-backend-function backend 'push)
+ (vc-call-backend backend 'push arg)
+ (user-error "VC push is unsupported for `%s'" backend))))
+
(defun vc-version-backup-file (file &optional rev)
"Return name of backup file for revision REV of FILE.
If version backups should be used for FILE, and there exists