Subject: bug#10589: closed (Re: bug#10589: 24.0.92; vc-register; use deduced backend for checking registered)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 30 Nov 2012 04:48:01 +0000

Your bug report

#10589: 24.0.92; vc-register; use deduced backend for checking registered

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
10589: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10589
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#10589: 24.0.92; vc-register; use deduced backend for checking registered
From: Chong Yidong <[email-masked]>
To: OKAZAKI Tetsurou <[email-masked]>
Cc: [email-masked]
Date: Fri, 30 Nov 2012 12:45:23 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

OKAZAKI Tetsurou <[email-masked]> writes:

> Current implementation of `vc-register' fails to register an
> unregistered item which is already registered to another backend.
>
> Using `vc-call-backend' with deduced `backend' instead of `vc-backend'
> and `vc-registered' resolves this issue.

I've committed your patch to trunk.  Thanks.

Subject: 24.0.92; vc-register; use deduced backend for checking registered
From: OKAZAKI Tetsurou <[email-masked]>
To: [email-masked]
Date: Tue, 24 Jan 2012 11:35:52 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Current implementation of `vc-register' fails to register an unregistered item
which is already registered to another backend.

Using `vc-call-backend' with deduced `backend' instead of `vc-backend' and
`vc-registered' resolves this issue.

=== modified file 'lisp/vc/vc.el'
*** lisp/vc/vc.el	2012-01-19 07:21:25 +0000
--- lisp/vc/vc.el	2012-01-20 19:55:38 +0000
*************** first backend that could register the fi
*** 1277,1287 ****
      (dolist (fname files)
        (let ((bname (get-file-buffer fname)))
  	(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
--- 1277,1284 ----
      (dolist (fname files)
        (let ((bname (get-file-buffer fname)))
  	(unless fname (setq fname buffer-file-name))
! 	(when (vc-call-backend backend 'registered fname)
! 	  (error "This file is already registered"))
  	;; Watch out for new buffers of size 0: the corresponding file
  	;; does not exist yet, even though buffer-modified-p is nil.
  	(when bname