branch: externals/diff-hl
commit 8fe73e2f674c78341777cbca1048584a97683137
Author: Dmitry Gutov <dmi...@gutov.dev>
Commit: Dmitry Gutov <dmi...@gutov.dev>

    Improve Bzr's support
    
    (Needs more testing.)
---
 diff-hl.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/diff-hl.el b/diff-hl.el
index 14d732b932..801feb233d 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -440,7 +440,7 @@ It can be a relative expression as well, such as \"HEAD^\" 
with Git, or
          ((eq state 'removed)
           `((1 ,(line-number-at-pos (point-max)) delete))))))))
 
-(defvar diff-hl-head-revision-alist '((Git . "HEAD") (Bzr . "-1") (Hg . ".")))
+(defvar diff-hl-head-revision-alist '((Git . "HEAD") (Bzr . "last:1") (Hg . 
".")))
 
 (defun diff-hl-head-revision (backend)
   (or (assoc-default backend diff-hl-head-revision-alist)
@@ -1306,6 +1306,13 @@ CONTEXT-LINES is the size of the unified diff context, 
defaults to 0."
                      "-i")
       (goto-char (point-min))
       (buffer-substring-no-properties (point) (line-end-position))))
+   (eq backend 'Bzr)
+   (with-temp-buffer
+      (vc-bzr-command (current-buffer) 0 nil
+                      "log" "--log-format=template" "--template-str='{revno}'"
+                      "-r" diff-hl-reference-revision)
+      (goto-char (point-min))
+      (buffer-substring-no-properties (point) (line-end-position)))
    (t
     diff-hl-reference-revision)))
 

Reply via email to