emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vc-pull/vc-push support


From: Dan Nicolaescu
Subject: vc-pull/vc-push support
Date: Tue, 25 May 2010 03:06:22 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

This has been sitting on my disk for quite a while, and did not see much 
progress :-(
vc-pull/vc-push without any options work for bzr, but that's about it.
Maybe someone would find this useful and want to help finish the 
implementation...


=== modified file 'lisp/log-view.el'
=== modified file 'lisp/vc-bzr.el'
--- lisp/vc-bzr.el      2010-04-21 02:10:50 +0000
+++ lisp/vc-bzr.el      2010-05-22 20:27:23 +0000
@@ -478,6 +478,18 @@
   (unless contents-done
     (with-temp-buffer (vc-bzr-command "revert" t 0 file))))
 
+(defun vc-bzr-pull (revision remote-location)
+  (apply 'vc-bzr-command "pull" t 1 nil
+        (append
+         (when revision (list "-r" revision))
+         (when remote-location (list remote-location)))))
+
+(defun vc-bzr-push (revision remote-location)
+  (apply 'vc-bzr-command "push" t 1 nil
+        (append
+         (when revision (list "-r" revision))
+         (when remote-location (list remote-location)))))
+
 (defvar log-view-message-re)
 (defvar log-view-file-re)
 (defvar log-view-font-lock-keywords)

=== modified file 'lisp/vc.el'
--- lisp/vc.el  2010-04-21 02:05:24 +0000
+++ lisp/vc.el  2010-04-22 08:14:22 +0000
@@ -336,6 +336,14 @@
 ;;   Mark conflicts as resolved.  Some VC systems need to run a
 ;;   command to mark conflicts as resolved.
 ;;
+;; - pull (revision remote-location)
+;;   
+;;   Experimental support for the pull operation in modern VCS.
+;;
+;; - push (revision remote-location)
+;;
+;;   Experimental support for the push operation in modern VCS.
+;;
 ;; HISTORY FUNCTIONS
 ;;
 ;; * print-log (files buffer &optional shortlog start-revision limit)
@@ -1925,6 +1933,46 @@
                     'retrieve-tag dir name update)
     (message "%s" (concat msg "done"))))
 
+
+;;;#autoload
+(defun vc-pull (revision remote-location)
+  "EXPERIMENTAL support for the PULL operation.
+WARNING: this just runs the VC backend command, it does not try to do any 
bookkeeping."
+  (interactive
+   (if current-prefix-arg
+       (list
+       (read-string "Revision (empty for latest): ")
+       (read-string "Remote location (empty for default): "))
+     (list nil nil)))
+  (let ((backend
+        (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
+              ((derived-mode-p 'dired-mode) (vc-responsible-backend 
default-directory))
+              (vc-mode (vc-backend buffer-file-name))))
+       rootdir working-revision)
+    (unless backend
+      (error "Buffer is not version controlled"))
+    (vc-call-backend backend 'pull revision remote-location)))
+
+;;;#autoload
+(defun vc-push (revision remote-location)
+  "EXPERIMENTAL support for the PUSH operation.
+WARNING: this just runs the VC backend command, it does not try to do any 
bookkeeping."
+  (interactive
+   (if current-prefix-arg
+       (list
+       (read-string "Revision (empty for latest): ")
+       (read-string "Remote location (empty for default): "))
+     (list nil nil)))
+  (let ((backend
+        (cond ((derived-mode-p 'vc-dir-mode)  vc-dir-backend)
+              ((derived-mode-p 'dired-mode) (vc-responsible-backend 
default-directory))
+              (vc-mode (vc-backend buffer-file-name))))
+       rootdir working-revision)
+    (unless backend
+      (error "Buffer is not version controlled"))
+    (vc-call-backend backend 'push revision remote-location)))
+
+
 ;; Miscellaneous other entry points
 
 ;; FIXME: this should be a defcustom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]