summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-bzr.el
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2012-09-17 04:07:36 -0800
committerDaniel Colascione <dancol@dancol.org>2012-09-17 04:07:36 -0800
commit2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch)
tree6dd6784d63e54cb18071df8e28fbdbc27d418728 /lisp/vc/vc-bzr.el
parentf701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff)
parentbb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff)
downloademacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz
Merge from trunk
Diffstat (limited to 'lisp/vc/vc-bzr.el')
-rw-r--r--lisp/vc/vc-bzr.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index c0dafda57b6..1eb33776f6a 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -534,7 +534,9 @@ in the branch repository (or whose status not be determined)."
;; FIXME: maybe it's overkill to check if both these
;; files exist.
(and (file-exists-p branch-format-file)
- (file-exists-p lastrev-file)))))
+ (file-exists-p lastrev-file)
+ (equal (emacs-bzr-version-dirstate l-c-parent-dir)
+ (emacs-bzr-version-dirstate rootdir))))))
t)))
(with-temp-buffer
(insert-file-contents branch-format-file)
@@ -553,13 +555,17 @@ in the branch repository (or whose status not be determined)."
(insert-file-contents lastrev-file)
(when (re-search-forward "[0-9]+" nil t)
(buffer-substring (match-beginning 0) (match-end 0))))))
- ;; fallback to calling "bzr revno"
+ ;; Fallback to calling "bzr revno --tree".
+ ;; The "--tree" matters for lightweight checkouts not on the same
+ ;; revision as the parent.
(let* ((result (vc-bzr-command-discarding-stderr
- vc-bzr-program "revno" (file-relative-name file)))
+ vc-bzr-program "revno" "--tree"
+ (file-relative-name file)))
(exitcode (car result))
(output (cdr result)))
(cond
- ((eq exitcode 0) (substring output 0 -1))
+ ((and (eq exitcode 0) (not (zerop (length output))))
+ (substring output 0 -1))
(t nil))))))
(defun vc-bzr-create-repo ()