From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: vc-pull/vc-push support Date: Tue, 25 May 2010 03:06:22 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274771200 15613 80.91.229.12 (25 May 2010 07:06:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 May 2010 07:06:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 25 09:06:39 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OGoDl-0006YV-SQ for ged-emacs-devel@m.gmane.org; Tue, 25 May 2010 09:06:38 +0200 Original-Received: from localhost ([127.0.0.1]:45123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGoDl-0003yE-6I for ged-emacs-devel@m.gmane.org; Tue, 25 May 2010 03:06:37 -0400 Original-Received: from [199.232.76.173] (port=58288 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGoDY-0003xq-QT for emacs-devel@gnu.org; Tue, 25 May 2010 03:06:24 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1OGoDX-0000RF-DE for emacs-devel@gnu.org; Tue, 25 May 2010 03:06:24 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:56659) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1OGoDX-0000RA-6G for emacs-devel@gnu.org; Tue, 25 May 2010 03:06:23 -0400 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OGoDX-0001Z4-0R for emacs-devel@gnu.org; Tue, 25 May 2010 03:06:23 -0400 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125227 Archived-At: 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