unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Nicolaescu <dann@gnu.org>
To: emacs-devel@gnu.org
Subject: vc-pull/vc-push support
Date: Tue, 25 May 2010 03:06:22 -0400	[thread overview]
Message-ID: <yxqfx1gwjdd.fsf@fencepost.gnu.org> (raw)


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	other threads:[~2010-05-25  7:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25  7:06 Dan Nicolaescu [this message]
2010-05-25  7:43 ` vc-pull/vc-push support 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yxqfx1gwjdd.fsf@fencepost.gnu.org \
    --to=dann@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).