branch: elpa/vc-fossil commit 8e34d7b3d5c1c1f19cba5767ab34ea8e1ee64f47 Author: pdo <pdo> Commit: pdo <pdo>
Added support for vc-push command. --- vc/el/vc-fossil.el | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/vc/el/vc-fossil.el b/vc/el/vc-fossil.el index 9ff9442..88031d3 100644 --- a/vc/el/vc-fossil.el +++ b/vc/el/vc-fossil.el @@ -85,6 +85,9 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (defvar vc-fossil-history nil) +(defvar vc-fossil-pull-history nil) +(defvar vc-fossil-push-history nil) + (defun vc-fossil-revision-granularity () 'repository) @@ -321,22 +324,16 @@ If `files` is nil return the status for all files." (if contents-done t (vc-fossil-command nil 0 file "revert"))) -(defun vc-fossil-pull (prompt) - "Pull upstream changes into the current branch. - -With a prefix argument or of PROMPT is non-nil, prompt for a specific -Fossil pull command. The default is \"fossil update\"." - (interactive "P") +(defun vc-fossil-do-prompted-command (prompt command &optional hist-var) (let* ((root (vc-fossil-root default-directory)) (buffer (format "*vc-fossil : %s*" (expand-file-name root))) (fossil-program "fossil") - (command "update") (args '())) (when prompt (setq args (split-string (read-shell-command "Run Fossil (like this): " - "fossil update" - 'vc-fossil-history) + (concat fossil-program " " command) + (or hist-var 'vc-fossil-history)) " " t)) (setq fossil-program (car args) command (cadr args) @@ -346,6 +343,22 @@ Fossil pull command. The default is \"fossil update\"." (vc-run-delayed (vc-compilation-mode 'Fossil))) (vc-set-async-update buffer))) +(defun vc-fossil-pull (prompt) + "Pull upstream changes into the current branch. + +With a prefix argument, or if PROMPT is non-nil, prompt for a specific +Fossil pull command. The default is \"fossil update\"." + (interactive "P") + (vc-fossil-do-prompted-command prompt "update" 'vc-fossil-pull-history)) + +(defun vc-fossil-push (prompt) + "Push changes to upstream repository. + +With a prefix argument or if PROMPT is non-nil, prompt for a specific +Fossil push command. The default is \"fossil push\"." + (interactive "P") + (vc-fossil-do-prompted-command prompt "push" 'vc-fossil-push-history)) + ;; HISTORY FUNCTIONS ;; FIXME, we actually already have short, start and limit, need to