[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: |
Tue, 13 Nov 2007 15:11:44 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Dan Nicolaescu <dann> 07/11/13 15:11:43
Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.480
retrieving revision 1.481
diff -u -b -r1.480 -r1.481
--- vc.el 11 Nov 2007 14:55:55 -0000 1.480
+++ vc.el 13 Nov 2007 15:11:41 -0000 1.481
@@ -1535,8 +1535,9 @@
(vc-call-backend backend 'create-repo))
;;;###autoload
-(defun vc-register (&optional set-revision comment)
- "Register the current file into a version control system.
+(defun vc-register (&optional fname set-revision comment)
+ "Register into a version control system.
+If FNAME is given register that file, 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.
@@ -1547,25 +1548,29 @@
register the file. If no backend declares itself responsible, the
first backend that could register the file is used."
(interactive "P")
- (unless buffer-file-name (error "No visited file"))
- (when (vc-backend buffer-file-name)
- (if (vc-registered buffer-file-name)
+ (when (and (null fname) (null buffer-file-name)) (error "No visited file"))
+
+ (let ((bname (if fname (get-file-buffer fname) buffer-file-name)))
+ (unless fname (setq fname buffer-file-name))
+ (when (vc-backend fname)
+ (if (vc-registered fname)
(error "This file is already registered")
(unless (y-or-n-p "Previous master file has vanished. Make a new one? ")
(error "Aborted"))))
;; Watch out for new buffers of size 0: the corresponding file
;; does not exist yet, even though buffer-modified-p is nil.
+ (when bname
+ (with-current-buffer bname
(if (and (not (buffer-modified-p))
(zerop (buffer-size))
(not (file-exists-p buffer-file-name)))
(set-buffer-modified-p t))
- (vc-buffer-sync)
-
- (vc-start-entry (list buffer-file-name)
+ (vc-buffer-sync)))
+ (vc-start-entry (list fname)
(if set-revision
(read-string (format "Initial revision level for %s: "
- (buffer-name)))
- (vc-call-backend (vc-responsible-backend buffer-file-name)
+ fname))
+ (vc-call-backend (vc-responsible-backend fname)
'init-revision))
(or comment (not vc-initial-comment))
nil
@@ -1580,7 +1585,7 @@
(unless vc-make-backup-files
(make-local-variable 'backup-inhibited)
(setq backup-inhibited t)))
- (message "Registering %s... done" file)))))
+ (message "Registering %s... done" file))))))
(defun vc-register-with (backend)
"Register the current file with a specified back end."
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/09
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/10
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v,
Dan Nicolaescu <=
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2007/11/15
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/23
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/11/27