summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-bzr.el
diff options
context:
space:
mode:
authorXue Fuqiao <xfq.free@gmail.com>2013-08-04 10:55:45 +0800
committerXue Fuqiao <xfq.free@gmail.com>2013-08-04 10:55:45 +0800
commitab419665caa6e2ad7465cf59ef902cc4ad1d2117 (patch)
treec1d67421021798a0dd4fc6f3c2cfb39ad374a8e7 /lisp/vc/vc-bzr.el
parent3cd51eaa039f2b954cc3fd5b325d0c2102643f04 (diff)
downloademacs-ab419665caa6e2ad7465cf59ef902cc4ad1d2117.tar.gz
emacs-ab419665caa6e2ad7465cf59ef902cc4ad1d2117.tar.bz2
emacs-ab419665caa6e2ad7465cf59ef902cc4ad1d2117.zip
Cleanup for vc-ignore.
* vc/vc.el (vc-ignore): Rewrite. (vc-default-ignore-completion-table): (vc--read-lines): (vc--add-line, vc--remove-regexp): New functions. * vc/vc-svn.el (vc-svn-ignore): Doc fix. (vc-svn-ignore-completion-table): New function. * vc/vc-hg.el (vc-hg-ignore): Rewrite. (vc-hg-ignore-completion-table): (vc-hg-find-ignore-file): New functions. * vc/vc-git.el (vc-git-ignore): Rewrite. (vc-git-ignore-completion-table): (vc-git-find-ignore-file): New functions. * vc/vc-dir.el (vc-dir-menu-map): Add menu for vc-dir-ignore. * vc/vc-bzr.el (vc-bzr-ignore): Rewrite. (vc-bzr-ignore-completion-table): (vc-bzr-find-ignore-file): New functions.
Diffstat (limited to 'lisp/vc/vc-bzr.el')
-rw-r--r--lisp/vc/vc-bzr.el22
1 files changed, 19 insertions, 3 deletions
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 9d2adde8554..e59a7dc5214 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -651,9 +651,25 @@ REV non-nil gets an error."
(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."
- (vc-bzr-command "ignore" t 0 file))
+(defun vc-bzr-ignore (file &optional directory remove)
+ "Ignore FILE under Bazaar.
+If DIRECTORY is non-nil, the repository to use will be deduced by
+DIRECTORY; if REMOVE is non-nil, remove FILE from ignored files."
+ (if remove
+ (if directory
+ (vc--remove-regexp file (vc-bzr-find-ignore-file directory))
+ (vc--remove-regexp file
+ (vc-bzr-find-ignore-file default-directory)))
+ (vc-bzr-command "ignore" t 0 file)))
+
+(defun vc-bzr-ignore-completion-table (file)
+ "Return the list of ignored files."
+ (vc--read-lines (vc-bzr-find-ignore-file file)))
+
+(defun vc-bzr-find-ignore-file (file)
+ "Return the root directory of the repository of FILE."
+ (expand-file-name ".bzrignore"
+ (vc-bzr-root file)))
(defun vc-bzr-checkout (_file &optional _editable rev)
(if rev (error "Operation not supported")