emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110220: Don't bother making files wr


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110220: Don't bother making files writable for commit with modern VCS
Date: Wed, 26 Sep 2012 23:59:21 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110220
fixes bug: http://debbugs.gnu.org/9781
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2012-09-26 23:59:21 -0700
message:
  Don't bother making files writable for commit with modern VCS
  
  * lisp/vc/vc.el (vc-next-action):
  Only gripe about committing read-only files for RCS and SCCS.
modified:
  lisp/ChangeLog
  lisp/vc/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-27 03:31:58 +0000
+++ b/lisp/ChangeLog    2012-09-27 06:59:21 +0000
@@ -1,3 +1,8 @@
+2012-09-27  Glenn Morris  <address@hidden>
+
+       * vc/vc.el (vc-next-action): Only gripe about committing read-only
+       files for RCS and SCCS.  (Bug#9781)
+
 2012-09-27  Chong Yidong  <address@hidden>
 
        * progmodes/verilog-mode.el (verilog-mode-release-emacs): Fix last

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2012-09-25 04:13:02 +0000
+++ b/lisp/vc/vc.el     2012-09-27 06:59:21 +0000
@@ -1105,24 +1105,27 @@
      ;; Files have local changes
      ((vc-compatible-state state 'edited)
       (let ((ready-for-commit files))
-       ;; If files are edited but read-only, give user a chance to correct.
-       (dolist (file files)
-         ;; If committing a mix of removed and edited files, the
-         ;; fileset has state = 'edited.  Rather than checking the
-         ;; state of each individual file in the fileset, it seems
-         ;; simplest to just check if the file exists.  Bug#9781.
-         (when (and (file-exists-p file) (not (file-writable-p file)))
-           ;; Make the file+buffer read-write.
-           (unless (y-or-n-p (format "%s is edited but read-only; make it 
writable and continue? " file))
-             (error "Aborted"))
-            ;; Maybe we somehow lost permissions on the directory.
-            (condition-case nil
-                (set-file-modes file (logior (file-modes file) 128))
-              (error (error "Unable to make file writable")))
-           (let ((visited (get-file-buffer file)))
-             (when visited
-               (with-current-buffer visited
-                 (read-only-mode -1))))))
+       ;; CVS, SVN and bzr don't care about read-only (bug#9781).
+       ;; RCS does, SCCS might (someone should check...).
+       (when (memq backend '(RCS SCCS))
+         ;; If files are edited but read-only, give user a chance to correct.
+         (dolist (file files)
+           ;; If committing a mix of removed and edited files, the
+           ;; fileset has state = 'edited.  Rather than checking the
+           ;; state of each individual file in the fileset, it seems
+           ;; simplest to just check if the file exists.        Bug#9781.
+           (when (and (file-exists-p file) (not (file-writable-p file)))
+             ;; Make the file+buffer read-write.
+             (unless (y-or-n-p (format "%s is edited but read-only; make it 
writable and continue? " file))
+               (error "Aborted"))
+             ;; Maybe we somehow lost permissions on the directory.
+             (condition-case nil
+                 (set-file-modes file (logior (file-modes file) 128))
+               (error (error "Unable to make file writable")))
+             (let ((visited (get-file-buffer file)))
+               (when visited
+                 (with-current-buffer visited
+                   (read-only-mode -1)))))))
        ;; Allow user to revert files with no changes
        (save-excursion
           (dolist (file files)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]