Mercurial > emacs
comparison lisp/vc-dispatcher.el @ 95674:0c2f83acfffe
(vc-dir-children-marked-p): Fix child check.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Sun, 08 Jun 2008 15:31:08 +0000 |
parents | df59f8d16051 |
children | 174ed97a282b |
comparison
equal
deleted
inserted
replaced
95673:52ec5c5888db | 95674:0c2f83acfffe |
---|---|
1055 (vc-dir-fileinfo->name data))))) | 1055 (vc-dir-fileinfo->name data))))) |
1056 nil)) | 1056 nil)) |
1057 | 1057 |
1058 (defun vc-dir-children-marked-p (arg) | 1058 (defun vc-dir-children-marked-p (arg) |
1059 ;; Return nil if none of the children of arg is marked. | 1059 ;; Return nil if none of the children of arg is marked. |
1060 (let* ((argdir (vc-dir-node-directory arg)) | 1060 (let* ((argdir-re (concat "\\`" (regexp-quote (vc-dir-node-directory arg)))) |
1061 (arglen (length argdir)) | |
1062 (is-child t) | 1061 (is-child t) |
1063 (crt arg) | 1062 (crt arg) |
1064 data dir) | 1063 data dir) |
1065 (while (and is-child (setq crt (ewoc-next vc-ewoc crt))) | 1064 (while (and is-child (setq crt (ewoc-next vc-ewoc crt))) |
1066 (setq data (ewoc-data crt)) | 1065 (setq data (ewoc-data crt)) |
1067 (setq dir (vc-dir-node-directory crt)) | 1066 (setq dir (vc-dir-node-directory crt)) |
1068 (if (string-equal argdir (substring dir 0 arglen)) | 1067 (if (string-match argdir-re dir) |
1069 (when (vc-dir-fileinfo->marked data) | 1068 (when (vc-dir-fileinfo->marked data) |
1070 (error "Cannot mark `%s', child `%s' marked" | 1069 (error "Cannot mark `%s', child `%s' marked" |
1071 (vc-dir-fileinfo->name (ewoc-data arg)) | 1070 (vc-dir-fileinfo->name (ewoc-data arg)) |
1072 (vc-dir-fileinfo->name data))) | 1071 (vc-dir-fileinfo->name data))) |
1073 ;; We are done, we got to an entry that is not a child of `arg'. | 1072 ;; We are done, we got to an entry that is not a child of `arg'. |