Commit 6e98ad29 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(vc-bzr-admin-lastrev): New constant.

(vc-bzr-file-name-relative): Use 'when' instead of 'and'.
(vc-bzr-status): Fix shadowing of variable 'status'.
(vc-bzr-workfile-version): Use correct path to 'last-revision' file.
Use `expand-file-name' instead of `concat'.
(vc-bzr-annotate-command): Use option name '--long' instead of '-l'.
Update annotation line regexp.  Fixes launchpad.net [Bug 137435].
parent 315912fb
2007-09-07 Riccardo Murri <riccardo.murri@gmail.com>
* vc-bzr.el (vc-bzr-admin-lastrev): New constant.
(vc-bzr-file-name-relative): Use 'when' instead of 'and'.
(vc-bzr-status): Fix shadowing of variable 'status'.
(vc-bzr-workfile-version): Use correct path to 'last-revision' file.
Use `expand-file-name' instead of `concat'.
(vc-bzr-annotate-command): Use option name '--long' instead of '-l'.
Update annotation line regexp. Fixes launchpad.net [Bug 137435].
2007-09-05 Jason Rumney <jasonr@gnu.org>
 
* frame.el (focus-follows-mouse): Doc-fix. Change default on w32.
......@@ -11,7 +21,7 @@
2007-09-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
 
* info.el (info-tool-bar-map): Add :rtl keyword to right/left-arrow and
prev/next-node.
prev/next-node.
 
* term/x-win.el (x-gtk-stock-map, icon-map-list): New variables.
(x-gtk-map-stock): New function.
......@@ -42,8 +52,7 @@
 
2007-08-30 Martin Rudalics <rudalics@gmx.at>
 
* files.el (backup-buffer-copy): Try to overwrite old backup
first.
* files.el (backup-buffer-copy): Try to overwrite old backup first.
 
2007-08-29 Martin Rudalics <rudalics@gmx.at>
 
......@@ -53,16 +62,14 @@
 
2007-08-28 Glenn Morris <rgm@gnu.org>
 
* progmodes/cc-langs.el (c-constant-kwds): Add java: true, false,
null.
* progmodes/cc-langs.el (c-constant-kwds): Add java: true, false, null.
 
2007-08-27 Alexandre Julliard <julliard@winehq.org>
 
* vc-git.el (vc-git-state): Call git-add --refresh to update the
* vc-git.el (vc-git-state): Call git-add --refresh to update the
state of the file.
(vc-git-workfile-unchanged-p): Delegate implementation to
vc-git-state.
(vc-git-create-repo): Fixed invalid command.
(vc-git-workfile-unchanged-p): Delegate implementation to vc-git-state.
(vc-git-create-repo): Fix invalid command.
 
2007-08-27 Richard Stallman <rms@gnu.org>
 
......@@ -5,7 +5,7 @@
;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com>
;; Keywords: tools
;; Created: Sept 2006
;; Version: 2007-08-03
;; Version: 2007-09-05
;; URL: http://launchpad.net/vc-bzr
;; This file is free software; you can redistribute it and/or modify
......@@ -104,6 +104,8 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' to the environment."
(concat vc-bzr-admin-dirname "/branch/format"))
(defconst vc-bzr-admin-revhistory
(concat vc-bzr-admin-dirname "/branch/revision-history"))
(defconst vc-bzr-admin-lastrev
(concat vc-bzr-admin-dirname "/branch/last-revision"))
;;;###autoload (defun vc-bzr-registered (file)
;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
......@@ -161,7 +163,7 @@ running `vc-bzr-state'."
(lexical-let*
((filename* (expand-file-name filename))
(rootdir (vc-bzr-root (file-name-directory filename*))))
(and rootdir
(when rootdir
(file-relative-name filename* rootdir))))
;; FIXME: Also get this in a non-registered sub-directory.
......@@ -197,13 +199,13 @@ If any error occurred in running `bzr status', then return nil."
(if (file-directory-p file) "/?" "")
"[ \t\n]*$")
nil t)
(let ((status (match-string 1)))
(lexical-let ((statusword (match-string 1)))
;; Erase the status text that matched.
(delete-region (match-beginning 0) (match-end 0))
(setq status
(and (equal ret 0) ; Seems redundant. --Stef
(intern (replace-regexp-in-string " " ""
status))))))
statusword))))))
(when status
(goto-char (point-min))
(skip-chars-forward " \n\t") ;Throw away spaces.
......@@ -238,12 +240,12 @@ If any error occurred in running `bzr status', then return nil."
(defun vc-bzr-workfile-version (file)
(lexical-let*
((rootdir (vc-bzr-root file))
(branch-format-file (concat rootdir "/" vc-bzr-admin-branch-format-file))
(revhistory-file (concat rootdir "/" vc-bzr-admin-revhistory))
(lastrev-file (concat rootdir "/" "branch/last-revision")))
;; Count lines in .bzr/branch/revision-history to avoid forking a
;; bzr process. This looks at internal files. May break if they
;; change their format.
(branch-format-file (expand-file-name vc-bzr-admin-branch-format-file
rootdir))
(revhistory-file (expand-file-name vc-bzr-admin-revhistory rootdir))
(lastrev-file (expand-file-name vc-bzr-admin-lastrev rootdir)))
;; This looks at internal files to avoid forking a bzr process.
;; May break if they change their format.
(if (file-exists-p branch-format-file)
(with-temp-buffer
(insert-file-contents branch-format-file)
......@@ -258,7 +260,6 @@ If any error occurred in running `bzr status', then return nil."
((looking-at "Bazaar Branch Format 6 (bzr 0.15)")
;; revno is the first number in .bzr/branch/last-revision
(insert-file-contents lastrev-file)
(goto-char (line-end-position))
(if (re-search-forward "[0-9]+" nil t)
(buffer-substring (match-beginning 0) (match-end 0))))))
;; fallback to calling "bzr revno"
......@@ -414,14 +415,14 @@ EDITABLE is ignored."
"Prepare BUFFER for `vc-annotate' on FILE.
Each line is tagged with the revision number, which has a `help-echo'
property containing author and date information."
(apply #'vc-bzr-command "annotate" buffer 0 file "-l" "--all"
(apply #'vc-bzr-command "annotate" buffer 0 file "--long" "--all"
(if version (list "-r" version)))
(with-current-buffer buffer
;; Store the tags for the annotated source lines in a hash table
;; to allow saving space by sharing the text properties.
(setq vc-bzr-annotation-table (make-hash-table :test 'equal))
(goto-char (point-min))
(while (re-search-forward "^\\( *[0-9]+\\) \\(.+\\) +\\([0-9]\\{8\\}\\) |"
(while (re-search-forward "^\\( *[0-9]+\\) +\\(.+\\) +\\([0-9]\\{8\\}\\) |"
nil t)
(let* ((rev (match-string 1))
(author (match-string 2))
......@@ -429,9 +430,6 @@ property containing author and date information."
(key (match-string 0))
(tag (gethash key vc-bzr-annotation-table)))
(unless tag
(save-match-data
(string-match " +\\'" author)
(setq author (substring author 0 (match-beginning 0))))
(setq tag (propertize rev 'help-echo (concat "Author: " author
", date: " date)
'mouse-face 'highlight))
......@@ -572,7 +570,6 @@ Optional argument LOCALP is always ignored."
(eval-after-load "vc"
'(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t))
(provide 'vc-bzr)
;; arch-tag: 8101bad8-4e92-4e7d-85ae-d8e08b4e7c06
;;; vc-bzr.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment