;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-LC;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
(apply 'vc-do-command buffer okstatus vc-bzr-program
file-or-list bzr-command args)))
+
;;;###autoload
(defconst vc-bzr-admin-dirname ".bzr"
"Name of the directory containing Bzr repository status files.")
"Return the root directory of the bzr repository containing FILE."
;; Cache technique copied from vc-arch.el.
(or (vc-file-getprop file 'bzr-root)
- (vc-file-setprop
- file 'bzr-root
- (vc-find-root file vc-bzr-admin-checkout-format-file))))
+ (let ((root (vc-find-root file vc-bzr-admin-checkout-format-file)))
+ (when root (vc-file-setprop file 'bzr-root root)))))
(defun vc-bzr-registered (file)
"Return non-nil if FILE is registered with bzr.
(defun vc-bzr-workfile-unchanged-p (file)
(eq 'unchanged (car (vc-bzr-status file))))
-(defun vc-bzr-workfile-version (file)
+(defun vc-bzr-working-revision (file)
(lexical-let*
((rootdir (vc-bzr-root file))
(branch-format-file (expand-file-name vc-bzr-admin-branch-format-file
"Register FILE under bzr.
Signal an error unless REV is nil.
COMMENT is ignored."
- (if rev (error "Can't register explicit version with bzr"))
+ (if rev (error "Can't register explicit revision with bzr"))
(vc-bzr-command "add" nil 0 files))
;; Could run `bzr status' in the directory and see if it succeeds, but
(defun vc-bzr-checkin (files rev comment)
"Check FILE in to bzr with log message COMMENT.
REV non-nil gets an error."
- (if rev (error "Can't check in a specific version with bzr"))
+ (if rev (error "Can't check in a specific revision with bzr"))
(vc-bzr-command "commit" nil 0 files "-m" comment))
(defun vc-bzr-find-version (file rev buffer)
(unless (fboundp 'vc-default-log-view-mode)
(add-hook 'log-view-mode-hook 'vc-bzr-log-view-mode)))
-(defun vc-bzr-show-log-entry (version)
- "Find entry for patch name VERSION in bzr change log buffer."
+(defun vc-bzr-show-log-entry (revision)
+ "Find entry for patch name REVISION in bzr change log buffer."
(goto-char (point-min))
(let (case-fold-search)
- (if (re-search-forward (concat "^-+\nrevno: " version "$") nil t)
+ (if (re-search-forward (concat "^-+\nrevno: " revision "$") nil t)
(beginning-of-line 0)
(goto-char (point-min)))))
(defun vc-bzr-diff (files &optional rev1 rev2 buffer)
"VC bzr backend for diff."
;; `bzr diff' exits with code 1 if diff is non-empty
- (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 1 files
- "--diff-options" (mapconcat 'identity
- (vc-diff-switches-list bzr)
- " ")
- (list "-r" (format "%s..%s"
- (or rev1 "revno:-1")
- (or rev2 "")))))
-
-(defalias 'vc-bzr-diff-tree 'vc-bzr-diff)
+ (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 1 files
+ "--diff-options" (mapconcat 'identity
+ (vc-diff-switches-list bzr)
+ " ")
+ (list "-r" (format "%s..%s"
+ (or rev1 "revno:-1")
+ (or rev2 "")))))
-;; FIXME: vc-{next,previous}-version need fixing in vc.el to deal with
-;; straight integer versions.
+;; FIXME: vc-{next,previous}-revision need fixing in vc.el to deal with
+;; straight integer revisions.
(defun vc-bzr-delete-file (file)
"Delete FILE and delete it in the bzr repository."
"Internal use.")
(make-variable-buffer-local 'vc-bzr-annotation-table)
-(defun vc-bzr-annotate-command (file buffer &optional version)
+(defun vc-bzr-annotate-command (file buffer &optional revision)
"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 "--long" "--all"
- (if version (list "-r" version)))
+ (if revision (list "-r" revision)))
(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.
;; and implement a command to run ediff and `bzr resolve' once the
;; changes have been merged.
(defun vc-bzr-dir-state (dir &optional localp)
- "Find the VC state of all files in DIR.
+ "Find the VC state of all files in DIR and its subdirectories.
Optional argument LOCALP is always ignored."
(let ((bzr-root-directory (vc-bzr-root dir))
(at-start t)
;; evidence of the contrary.
(setq at-start t)
(with-temp-buffer
- (vc-bzr-command "ls" t 0 nil "--versioned" "--non-recursive")
+ (buffer-disable-undo) ;; Because these buffers can get huge
+ (vc-bzr-command "ls" t 0 nil "--versioned")
(goto-char (point-min))
(while (or at-start
(eq 0 (forward-line)))
(setq at-start nil)
(cond
((looking-at "^added")
- (setq current-vc-state 'edited)
+ (setq current-vc-state 'added)
(setq current-bzr-state 'added))
((looking-at "^kind changed")
(setq current-vc-state 'edited)
((looking-at "^renamed")
(setq current-vc-state 'edited)
(setq current-bzr-state 'renamed))
- ((looking-at "^\\(unknown\\|ignored\\)")
- (setq current-vc-state nil)
+ ((looking-at "^ignored")
+ (setq current-vc-state 'ignored)
+ (setq current-bzr-state 'not-versioned))
+ ((looking-at "^unknown")
+ (setq current-vc-state 'unregistered)
(setq current-bzr-state 'not-versioned))
((looking-at " ")
;; file names are indented by two spaces
(vc-file-setprop file 'vc-state current-vc-state)
(vc-file-setprop file 'vc-bzr-state current-bzr-state)
(when (eq 'added current-bzr-state)
- (vc-file-setprop file 'vc-workfile-version "0"))))
+ (vc-file-setprop file 'vc-working-revision "0"))))
(when (eq 'not-versioned current-bzr-state)
(let ((file (expand-file-name
(buffer-substring-no-properties