[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc.el,v
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc.el,v |
Date: |
Sun, 15 Jun 2008 02:52:50 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Dan Nicolaescu <dann> 08/06/15 02:52:49
Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.685
retrieving revision 1.686
diff -u -b -r1.685 -r1.686
--- vc.el 13 Jun 2008 14:51:03 -0000 1.685
+++ vc.el 15 Jun 2008 02:52:43 -0000 1.686
@@ -1042,6 +1042,8 @@
(progn
(set-buffer vc-parent-buffer)
(vc-deduce-fileset)))
+ ((not buffer-file-name)
+ (error "Buffer %s is not associated with a file" (buffer-name)))
((and allow-unregistered (not (vc-registered buffer-file-name)))
(list (vc-responsible-backend
(file-name-directory (buffer-file-name)))
@@ -1144,7 +1146,7 @@
((eq state 'ignored)
(error "Fileset files are ignored by the version-control system."))
((or (null state) (eq state 'unregistered))
- (mapc (lambda (arg) (vc-register nil arg)) files))
+ (vc-register nil vc-fileset))
;; Files are up-to-date, or need a merge and user specified a revision
((or (eq state 'up-to-date) (and verbose (eq state 'needs-update)))
(cond
@@ -1294,9 +1296,10 @@
(vc-call-backend backend 'create-repo))
;;;###autoload
-(defun vc-register (&optional set-revision fname comment)
+(defun vc-register (&optional set-revision vc-fileset comment)
"Register into a version control system.
-If FNAME is given register that file, otherwise register the current file.
+If VC-FILESET is given, register the files in that fileset.
+Otherwise register the current file.
With prefix argument SET-REVISION, allow user to specify initial revision
level. If COMMENT is present, use that as an initial comment.
@@ -1307,9 +1310,12 @@
register the file. If no backend declares itself responsible, the
first backend that could register the file is used."
(interactive "P")
- (when (and (null fname) (null buffer-file-name)) (error "No visited file"))
-
- (let ((bname (if fname (get-file-buffer fname) (current-buffer))))
+ (let* ((fileset-arg (or vc-fileset (vc-deduce-fileset nil t)))
+ (backend (car fileset-arg))
+ (files (nth 1 fileset-arg))
+ (fileset-only-files (nth 2 fileset-arg)))
+ (dolist (fname fileset-only-files)
+ (let ((bname (get-file-buffer fname)))
(unless fname (setq fname buffer-file-name))
(when (vc-backend fname)
(if (vc-registered fname)
@@ -1324,28 +1330,31 @@
(zerop (buffer-size))
(not (file-exists-p buffer-file-name)))
(set-buffer-modified-p t))
- (vc-buffer-sync)))
- (vc-start-logentry (list fname)
+ (vc-buffer-sync)))))
+ (lexical-let ((backend backend)
+ (files fileset-only-files))
+ (vc-start-logentry
+ files
(if set-revision
(read-string (format "Initial revision level for %s: "
- fname))
- (vc-call-backend (vc-responsible-backend fname)
- 'init-revision))
+ files))
+ (vc-call-backend backend 'init-revision))
(or comment (not vc-initial-comment))
nil
"Enter initial comment."
"*VC-log*"
(lambda (files rev comment)
+ (message "Registering %s... " files)
+ (dolist (file files)
+ (vc-file-clearprops file))
+ (vc-call-backend backend 'register files rev comment)
(dolist (file files)
- (message "Registering %s... " file)
- (let ((backend (vc-responsible-backend file t)))
- (vc-file-clearprops file)
- (vc-call-backend backend 'register (list file) rev
comment)
(vc-file-setprop file 'vc-backend backend)
(unless vc-make-backup-files
+ ;; FIXME: Is this code right? What is it supposed to do?
(make-local-variable 'backup-inhibited)
(setq backup-inhibited t)))
- (message "Registering %s... done" file))))))
+ (message "Registering %s... done" files))))))
(defun vc-register-with (backend)
"Register the current file with a specified back end."
@@ -2000,13 +2009,6 @@
vc-ewoc
(lambda (crt) (not (eq (vc-dir-fileinfo->state crt) 'up-to-date)))))
-(defun vc-dir-register ()
- "Register the marked files, or the current file if no marks."
- (interactive)
- ;; FIXME: Just pass the fileset to vc-register.
- (mapc (lambda (arg) (vc-register nil arg))
- (or (vc-dir-marked-files) (list (vc-dir-current-file)))))
-
(defun vc-default-status-fileinfo-extra (backend file)
"Default absence of extra information returned for a file."
nil)
@@ -2053,7 +2055,7 @@
(let ((map (current-local-map)))
(define-key map "v" 'vc-next-action) ;; C-x v v
(define-key map "=" 'vc-diff) ;; C-x v =
- (define-key map "i" 'vc-dir-register) ;; C-x v i
+ (define-key map "i" 'vc-register) ;; C-x v i
(define-key map "+" 'vc-update) ;; C-x v +
(define-key map "l" 'vc-print-log) ;; C-x v l
;; More confusing than helpful, probably
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Sam Steingold, 2008/06/05
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Sam Steingold, 2008/06/12
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/13
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/13
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v,
Dan Nicolaescu <=
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/15
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2008/06/17
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Sam Steingold, 2008/06/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/22
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/22
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/23
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/24
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2008/06/26