# HG changeset patch # User Oleksandr Gavenko # Date 1413569309 -10800 # Node ID e7728b2522b25fc06eb0d735406683cd5c66bd21 # Parent aadda3d1653c827fed03e3c13d88f15c1ae8f59c Handle HG MQ from non-root directory. diff -r aadda3d1653c -r e7728b2522b2 .emacs-my --- a/.emacs-my Fri Oct 17 20:47:53 2014 +0300 +++ b/.emacs-my Fri Oct 17 21:08:29 2014 +0300 @@ -2114,14 +2114,19 @@ "Same as `vc-root-diff' but for Hg with C-u show latest MQ patch and with C-u C-u show MQ patch and local changes." (interactive "P") - (if (and prefix (eq (vc-deduce-backend) 'Hg) (eq (vc-hg-command nil t "." "log" "-r" "qparent") 0)) - (let* ( (rootdir (vc-call-backend 'Hg 'root default-directory)) (default-directory rootdir) ) - (cond - ((equal prefix '(4)) - (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" "qtip")) - ((equal prefix '(16)) - (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" nil)) )) - (call-interactively 'vc-root-diff nil))) + (when (eq 'non-hg-mq + (catch 'break + (unless (and prefix (eq (vc-deduce-backend) 'Hg)) + (throw 'break 'non-hg-mq)) + (let* ( (rootdir (vc-call-backend 'Hg 'root default-directory)) (default-directory rootdir) ) + (unless (eq (vc-hg-command nil t rootdir "log" "-r" "qtip") 0) + (throw 'break 'non-hg-mq)) + (cond + ((equal prefix '(4)) + (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" "qtip")) + ((equal prefix '(16)) + (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" nil)) )))) + (call-interactively 'vc-root-diff nil) )) (global-set-key (kbd "C-x v D") 'my-vc-root-diff)