diff options
| author | Dan Nicolaescu | 2009-03-23 16:25:30 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-03-23 16:25:30 +0000 |
| commit | be14a4253c35de66b434959cbd8ae24129bed4e5 (patch) | |
| tree | 74fffeeee330bb5e6c826fe1e9d35e09bfe00320 | |
| parent | 116253083c991a7b4924ceadd27be499f0b66253 (diff) | |
| download | emacs-be14a4253c35de66b434959cbd8ae24129bed4e5.tar.gz emacs-be14a4253c35de66b434959cbd8ae24129bed4e5.zip | |
(vc-bzr-working-revision): Add support for lightweight
checkouts. (Bug#2157)
(vc-bzr-after-dir-status): Ignore a warning for bzr status.
(vc-bzr-dir-extra-headers): Add headers for lightweight checkouts.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/vc-bzr.el | 59 |
2 files changed, 57 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01c01e10435..eb146df5d4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-03-23 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-bzr.el (vc-bzr-working-revision): Add support for lightweight | ||
| 4 | checkouts. (Bug#2157) | ||
| 5 | (vc-bzr-after-dir-status): Ignore a warning for bzr status. | ||
| 6 | (vc-bzr-dir-extra-headers): Add headers for lightweight checkouts. | ||
| 7 | |||
| 1 | 2009-03-22 Richard M Stallman <rms@gnu.org> | 8 | 2009-03-22 Richard M Stallman <rms@gnu.org> |
| 2 | 9 | ||
| 3 | * mail/rmail.el (rmail-expunge): Update summary buffer even if DONT-SHOW. | 10 | * mail/rmail.el (rmail-expunge): Update summary buffer even if DONT-SHOW. |
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 5c8b50bc191..72d683fd549 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -327,7 +327,24 @@ If any error occurred in running `bzr status', then return nil." | |||
| 327 | (lastrev-file (expand-file-name vc-bzr-admin-lastrev rootdir))) | 327 | (lastrev-file (expand-file-name vc-bzr-admin-lastrev rootdir))) |
| 328 | ;; This looks at internal files to avoid forking a bzr process. | 328 | ;; This looks at internal files to avoid forking a bzr process. |
| 329 | ;; May break if they change their format. | 329 | ;; May break if they change their format. |
| 330 | (if (file-exists-p branch-format-file) | 330 | (if (and (file-exists-p branch-format-file) |
| 331 | ;; For lightweight checkouts (obtained with bzr checkout --lightweight) | ||
| 332 | ;; the branch-format-file does not contain the revision | ||
| 333 | ;; information, we need to look up the branch-format-file | ||
| 334 | ;; in the place where the lightweight checkout comes | ||
| 335 | ;; from. We only do that if it's a local file. | ||
| 336 | (let ((location-fname (expand-file-name | ||
| 337 | (concat vc-bzr-admin-dirname | ||
| 338 | "/branch/location") rootdir))) | ||
| 339 | ;; The existence of this file is how we distinguish | ||
| 340 | ;; lightweight checkouts. | ||
| 341 | (if (file-exists-p location-fname) | ||
| 342 | (with-temp-buffer | ||
| 343 | (insert-file-contents location-fname) | ||
| 344 | (when (re-search-forward "file://\(.+\)" nil t) | ||
| 345 | (setq branch-format-file (match-string 1)) | ||
| 346 | (file-exists-p branch-format-file))) | ||
| 347 | t))) | ||
| 331 | (with-temp-buffer | 348 | (with-temp-buffer |
| 332 | (insert-file-contents branch-format-file) | 349 | (insert-file-contents branch-format-file) |
| 333 | (goto-char (point-min)) | 350 | (goto-char (point-min)) |
| @@ -619,6 +636,11 @@ stream. Standard error output is discarded." | |||
| 619 | ;; For a non existent file FOO, the output is: | 636 | ;; For a non existent file FOO, the output is: |
| 620 | ;; bzr: ERROR: Path(s) do not exist: FOO | 637 | ;; bzr: ERROR: Path(s) do not exist: FOO |
| 621 | ("bzr" . not-found) | 638 | ("bzr" . not-found) |
| 639 | ;; If the tree is not up to date, bzr will print this warning: | ||
| 640 | ;; working tree is out of date, run 'bzr update' | ||
| 641 | ;; ignore it. | ||
| 642 | ;; FIXME: maybe this warning can be put in the vc-dir header... | ||
| 643 | ("wor" . not-found) | ||
| 622 | ;; Ignore "P " and "P." for pending patches. | 644 | ;; Ignore "P " and "P." for pending patches. |
| 623 | )) | 645 | )) |
| 624 | (translated nil) | 646 | (translated nil) |
| @@ -671,16 +693,35 @@ stream. Standard error output is discarded." | |||
| 671 | `(vc-bzr-after-dir-status (quote ,update-function)))) | 693 | `(vc-bzr-after-dir-status (quote ,update-function)))) |
| 672 | 694 | ||
| 673 | (defun vc-bzr-dir-extra-headers (dir) | 695 | (defun vc-bzr-dir-extra-headers (dir) |
| 674 | (let ((str (with-temp-buffer | 696 | (let* |
| 675 | (vc-bzr-command "info" t 0 dir) | 697 | ((str (with-temp-buffer |
| 676 | (buffer-string)))) | 698 | (vc-bzr-command "info" t 0 dir) |
| 699 | (buffer-string))) | ||
| 700 | (light-checkout | ||
| 701 | (when (string-match ".+light checkout root: \\(.+\\)$" str) | ||
| 702 | (match-string 1 str))) | ||
| 703 | (light-checkout-branch | ||
| 704 | (when light-checkout | ||
| 705 | (when (string-match ".+checkout of branch: \\(.+\\)$" str) | ||
| 706 | (match-string 1 str))))) | ||
| 677 | (concat | 707 | (concat |
| 678 | (propertize "Parent branch: " 'face 'font-lock-type-face) | 708 | (propertize "Parent branch : " 'face 'font-lock-type-face) |
| 679 | (propertize | 709 | (propertize |
| 680 | (if (string-match "parent branch: \\(.+\\)$" str) | 710 | (if (string-match "parent branch: \\(.+\\)$" str) |
| 681 | (match-string 1 str) | 711 | (match-string 1 str) |
| 682 | "None") | 712 | "None") |
| 683 | 'face 'font-lock-variable-name-face)))) | 713 | 'face 'font-lock-variable-name-face) |
| 714 | "\n" | ||
| 715 | (when light-checkout | ||
| 716 | (concat | ||
| 717 | (propertize "Light checkout root: " 'face 'font-lock-type-face) | ||
| 718 | (propertize light-checkout 'face 'font-lock-variable-name-face) | ||
| 719 | "\n")) | ||
| 720 | (when light-checkout-branch | ||
| 721 | (concat | ||
| 722 | (propertize "Checkout of branch : " 'face 'font-lock-type-face) | ||
| 723 | (propertize light-checkout-branch 'face 'font-lock-variable-name-face) | ||
| 724 | "\n"))))) | ||
| 684 | 725 | ||
| 685 | ;;; Revision completion | 726 | ;;; Revision completion |
| 686 | 727 | ||