comparison lisp/vc-bzr.el @ 91302:56a72e2bd635

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-306
author Miles Bader <miles@gnu.org>
date Sat, 29 Dec 2007 02:39:17 +0000
parents 4b09bb044f38 71fc7b1db920
children c938ab6810a4
comparison
equal deleted inserted replaced
91301:7774e5860c70 91302:56a72e2bd635
483 483
484 ;; TODO: it would be nice to mark the conflicted files in VC Dired, 484 ;; TODO: it would be nice to mark the conflicted files in VC Dired,
485 ;; and implement a command to run ediff and `bzr resolve' once the 485 ;; and implement a command to run ediff and `bzr resolve' once the
486 ;; changes have been merged. 486 ;; changes have been merged.
487 (defun vc-bzr-dir-state (dir &optional localp) 487 (defun vc-bzr-dir-state (dir &optional localp)
488 "Find the VC state of all files in DIR. 488 "Find the VC state of all files in DIR and its subdirectories.
489 Optional argument LOCALP is always ignored." 489 Optional argument LOCALP is always ignored."
490 (let ((bzr-root-directory (vc-bzr-root dir)) 490 (let ((bzr-root-directory (vc-bzr-root dir))
491 (at-start t) 491 (at-start t)
492 current-bzr-state current-vc-state) 492 current-bzr-state current-vc-state)
493 ;; Check that DIR is a bzr repository. 493 ;; Check that DIR is a bzr repository.
496 ;; `bzr ls --versioned' lists all versioned files; 496 ;; `bzr ls --versioned' lists all versioned files;
497 ;; assume they are up-to-date, unless we are given 497 ;; assume they are up-to-date, unless we are given
498 ;; evidence of the contrary. 498 ;; evidence of the contrary.
499 (setq at-start t) 499 (setq at-start t)
500 (with-temp-buffer 500 (with-temp-buffer
501 (vc-bzr-command "ls" t 0 nil "--versioned" "--non-recursive") 501 (buffer-disable-undo) ;; Because these buffers can get huge
502 (vc-bzr-command "ls" t 0 nil "--versioned")
502 (goto-char (point-min)) 503 (goto-char (point-min))
503 (while (or at-start 504 (while (or at-start
504 (eq 0 (forward-line))) 505 (eq 0 (forward-line)))
505 (setq at-start nil) 506 (setq at-start nil)
506 (let ((file (expand-file-name 507 (let ((file (expand-file-name
530 (setq current-vc-state 'edited) 531 (setq current-vc-state 'edited)
531 (setq current-bzr-state 'modified)) 532 (setq current-bzr-state 'modified))
532 ((looking-at "^renamed") 533 ((looking-at "^renamed")
533 (setq current-vc-state 'edited) 534 (setq current-vc-state 'edited)
534 (setq current-bzr-state 'renamed)) 535 (setq current-bzr-state 'renamed))
535 ((looking-at "^\\(unknown\\|ignored\\)") 536 ((looking-at "^ignored")
536 (setq current-vc-state nil) 537 (setq current-vc-state 'ignored)
538 (setq current-bzr-state 'not-versioned))
539 ((looking-at "^unknown")
540 (setq current-vc-state 'unregistered)
537 (setq current-bzr-state 'not-versioned)) 541 (setq current-bzr-state 'not-versioned))
538 ((looking-at " ") 542 ((looking-at " ")
539 ;; file names are indented by two spaces 543 ;; file names are indented by two spaces
540 (when current-vc-state 544 (when current-vc-state
541 (let ((file (expand-file-name 545 (let ((file (expand-file-name