unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* vc-pull/vc-push support
@ 2010-05-25  7:06 Dan Nicolaescu
  2010-05-25  7:43 ` Miles Bader
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Nicolaescu @ 2010-05-25  7:06 UTC (permalink / raw)
  To: emacs-devel


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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-25  9:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  7:06 vc-pull/vc-push support Dan Nicolaescu
2010-05-25  7:43 ` Miles Bader
2010-05-25  7:48   ` Dan Nicolaescu
2010-05-25  9:37 ` Uday S Reddy
2010-05-25  9:45 ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).