emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113589: Merge: Add vc-ignore.


From: Xue Fuqiao
Subject: [Emacs-diffs] trunk r113589: Merge: Add vc-ignore.
Date: Tue, 30 Jul 2013 00:31:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113589 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Xue Fuqiao <address@hidden>
branch nick: trunk
timestamp: Tue 2013-07-30 08:31:34 +0800
message:
  Merge: Add vc-ignore.
modified:
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/vc/pcvs.el                pcvs.el-20091113204419-o5vbwnq5f7feedwu-1782
  lisp/vc/vc-bzr.el              vcbzr.el-20091113204419-o5vbwnq5f7feedwu-5055
  lisp/vc/vc-cvs.el              vccvs.el-20091113204419-o5vbwnq5f7feedwu-1927
  lisp/vc/vc-dir.el              vcdir.el-20091113204419-o5vbwnq5f7feedwu-8693
  lisp/vc/vc-git.el              vcgit.el-20091113204419-o5vbwnq5f7feedwu-5070
  lisp/vc/vc-hg.el               vchg.el-20091113204419-o5vbwnq5f7feedwu-5062
  lisp/vc/vc-svn.el              vcsvn.el-20091113204419-o5vbwnq5f7feedwu-2575
  lisp/vc/vc.el                  vc.el-20091113204419-o5vbwnq5f7feedwu-502
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-07-27 00:09:51 +0000
+++ b/etc/NEWS  2013-07-30 00:29:09 +0000
@@ -237,6 +237,7 @@
 
 *** `D' displays diffs between VC-controlled whole tree revisions.
 *** `L' lists the change log for the current VC controlled tree in a window.
+*** `I' ignores the file under current version control system.
 
 ** cl-lib
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-29 16:34:53 +0000
+++ b/lisp/ChangeLog    2013-07-30 00:29:09 +0000
@@ -163,6 +163,26 @@
        (desktop--make-frame): On cl-delete-if call, check parameter name,
        not full parameter.
 
+2013-07-30  Xue Fuqiao  <address@hidden>
+
+       * vc/vc.el (vc-ignore): New function.
+
+       * vc/vc-svn.el (vc-svn-ignore): New function.
+
+       * vc/vc-hg.el (vc-hg-ignore): New function.
+
+       * vc/vc-git.el (vc-git-ignore): New function.
+
+       * vc/vc-dir.el (vc-dir-mode-map): Add key binding for vc-dir-ignore
+       (vc-dir-ignore): New function.
+
+       * vc/vc-cvs.el (vc-cvs-ignore): New function.
+       (cvs-append-to-ignore): Moved from pcvs.el.
+
+       * vc/vc-bzr.el (vc-bzr-ignore): New function.
+
+       * vc/pcvs.el (vc-cvs): Require 'vc-cvs.
+
 2013-07-24  Juanma Barranquero  <address@hidden>
 
        * desktop.el (desktop-restoring-frames-p): Return a true boolean.

=== modified file 'lisp/vc/pcvs.el'
--- a/lisp/vc/pcvs.el   2013-01-08 17:34:35 +0000
+++ b/lisp/vc/pcvs.el   2013-07-30 00:25:31 +0000
@@ -122,6 +122,7 @@
 (require 'pcvs-util)
 (require 'pcvs-parse)
 (require 'pcvs-info)
+(require 'vc-cvs)
 
 
 ;;;;
@@ -1970,25 +1971,6 @@
 (declare-function vc-editable-p "vc" (file))
 (declare-function vc-checkout "vc" (file &optional writable rev))
 
-(defun cvs-append-to-ignore (dir str &optional old-dir)
-  "Add STR to the .cvsignore file in DIR.
-If OLD-DIR is non-nil, then this is a directory that we don't want
-to hear about anymore."
-  (with-current-buffer
-      (find-file-noselect (expand-file-name ".cvsignore" dir))
-    (when (ignore-errors
-           (and buffer-read-only
-                (eq 'CVS (vc-backend buffer-file-name))
-                (not (vc-editable-p buffer-file-name))))
-      ;; CVSREAD=on special case
-      (vc-checkout buffer-file-name t))
-    (goto-char (point-max))
-    (unless (bolp) (insert "\n"))
-    (insert str (if old-dir "/\n" "\n"))
-    (if cvs-sort-ignore-file (sort-lines nil (point-min) (point-max)))
-    (save-buffer)))
-
-
 (defun cvs-mode-find-file-other-window (e)
   "Select a buffer containing the file in another window."
   (interactive (list last-input-event))

=== modified file 'lisp/vc/vc-bzr.el'
--- a/lisp/vc/vc-bzr.el 2013-05-28 07:01:59 +0000
+++ b/lisp/vc/vc-bzr.el 2013-07-30 00:25:31 +0000
@@ -651,6 +651,12 @@
           (vc-bzr-command "cat" t 0 file "-r" rev)
         (vc-bzr-command "cat" t 0 file))))
 
+(defun vc-bzr-ignore (file)
+  "Ignore FILE under Bazaar."
+  (interactive)
+  (vc-bzr-command "ignore" (get-buffer-create "*vc-ignore*") 0
+                 file))
+
 (defun vc-bzr-checkout (_file &optional _editable rev)
   (if rev (error "Operation not supported")
     ;; Else, there's nothing to do.

=== modified file 'lisp/vc/vc-cvs.el'
--- a/lisp/vc/vc-cvs.el 2013-06-09 11:15:54 +0000
+++ b/lisp/vc/vc-cvs.el 2013-07-30 00:25:31 +0000
@@ -1226,6 +1226,28 @@
                    table (lambda () (vc-cvs-revision-table (car files))))))
     table))
 
+(defun vc-cvs-ignore (file)
+  "Ignore FILE under CVS."
+  (interactive)
+  (cvs-append-to-ignore (file-name-directory file) file))
+
+(defun cvs-append-to-ignore (dir str &optional old-dir)
+  "In DIR, add STR to the .cvsignore file.
+If OLD-DIR is non-nil, then this is a directory that we don't want
+to hear about anymore."
+  (with-current-buffer
+      (find-file-noselect (expand-file-name ".cvsignore" dir))
+    (when (ignore-errors
+           (and buffer-read-only
+                (eq 'CVS (vc-backend buffer-file-name))
+                (not (vc-editable-p buffer-file-name))))
+      ;; CVSREAD=on special case
+      (vc-checkout buffer-file-name t))
+    (goto-char (point-max))
+    (unless (bolp) (insert "\n"))
+    (insert str (if old-dir "/\n" "\n"))
+    (if cvs-sort-ignore-file (sort-lines nil (point-min) (point-max)))
+    (save-buffer)))
 
 (provide 'vc-cvs)
 

=== modified file 'lisp/vc/vc-dir.el'
--- a/lisp/vc/vc-dir.el 2013-07-27 00:09:51 +0000
+++ b/lisp/vc/vc-dir.el 2013-07-30 00:29:09 +0000
@@ -279,6 +279,7 @@
     (define-key map "Q" 'vc-dir-query-replace-regexp)
     (define-key map (kbd "M-s a C-s")   'vc-dir-isearch)
     (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp)
+    (define-key map "I" 'vc-dir-ignore)
 
     ;; Hook up the menu.
     (define-key map [menu-bar vc-dir-mode]
@@ -791,6 +792,11 @@
   (tags-query-replace from to delimited
                      '(mapcar 'car (vc-dir-marked-only-files-and-states))))
 
+(defun vc-dir-ignore ()
+  "Ignore the current file."
+  (interactive)
+  (vc-ignore (vc-dir-current-file)))
+
 (defun vc-dir-current-file ()
   (let ((node (ewoc-locate vc-ewoc)))
     (unless node

=== modified file 'lisp/vc/vc-git.el'
--- a/lisp/vc/vc-git.el 2013-05-28 07:47:11 +0000
+++ b/lisp/vc/vc-git.el 2013-07-30 00:25:31 +0000
@@ -103,6 +103,8 @@
 ;; - rename-file (old new)                         OK
 ;; - find-file-hook ()                             NOT NEEDED
 
+;;; Code:
+
 (eval-when-compile
   (require 'cl-lib)
   (require 'vc)
@@ -678,6 +680,18 @@
      nil
      "cat-file" "blob" (concat (if rev rev "HEAD") ":" fullname))))
 
+(defun vc-git-ignore (file)
+  "Ignore FILE under Git."
+  (interactive)
+  (with-temp-buffer
+    (insert-file-contents
+     (let (gitignore (concat (file-name-as-directory (vc-git-root
+                                                     default-directory)) 
".gitignore"))
+       (unless (search-forward file nil t)
+        (goto-char (point-max))
+        (insert (concat "\n" file "\n"))
+        (write-region 1 (point-max) gitignore))))))
+
 (defun vc-git-checkout (file &optional _editable rev)
   (vc-git-command nil 0 file "checkout" (or rev "HEAD")))
 

=== modified file 'lisp/vc/vc-hg.el'
--- a/lisp/vc/vc-hg.el  2013-05-28 07:47:11 +0000
+++ b/lisp/vc/vc-hg.el  2013-07-30 00:25:31 +0000
@@ -459,6 +459,18 @@
         (vc-hg-command buffer 0 file "cat" "-r" rev)
       (vc-hg-command buffer 0 file "cat"))))
 
+(defun vc-hg-ignore (file)
+  "Ignore FILE under Mercurial."
+  (interactive)
+  (with-temp-buffer
+    (insert-file-contents 
+     (let (hgignore (concat (file-name-as-directory (vc-hg-root
+                                                    default-directory)) 
".hgignore"))
+       (unless (search-forward file nil t)
+        (goto-char (point-max))
+        (insert (concat "\n" file "\n"))
+        (write-region 1 (point-max) hgignore))))))
+
 ;; Modeled after the similar function in vc-bzr.el
 (defun vc-hg-checkout (file &optional _editable rev)
   "Retrieve a revision of FILE.

=== modified file 'lisp/vc/vc-svn.el'
--- a/lisp/vc/vc-svn.el 2013-05-28 07:01:59 +0000
+++ b/lisp/vc/vc-svn.el 2013-07-30 00:25:31 +0000
@@ -352,6 +352,12 @@
                (concat "-r" rev))
           (vc-switches 'SVN 'checkout))))
 
+(defun vc-svn-ignore (file)
+  "Ignore FILE under Subversion."
+  (interactive)
+  (vc-svn-command (get-buffer-create "*vc-ignore*") 0
+                 file "propedit" "svn:ignore"))
+
 (defun vc-svn-checkout (file &optional editable rev)
   (message "Checking out %s..." file)
   (with-current-buffer (or (get-file-buffer file) (current-buffer))

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2013-06-11 22:14:30 +0000
+++ b/lisp/vc/vc.el     2013-07-30 00:25:31 +0000
@@ -1332,6 +1332,12 @@
   (let ((vc-handled-backends (list backend)))
     (call-interactively 'vc-register)))
 
+(defun vc-ignore (file)
+  "Ignore FILE under the current VCS."
+  (interactive "fIgnore file: ")
+  (let ((backend (vc-backend file)))
+    (vc-call-backend backend 'ignore file)))
+
 (defun vc-checkout (file &optional writable rev)
   "Retrieve a copy of the revision REV of FILE.
 If WRITABLE is non-nil, make sure the retrieved file is writable.


reply via email to

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