.emacs-my
changeset 1163 e7728b2522b2
parent 1162 aadda3d1653c
child 1165 51cebd6ff0ac
equal deleted inserted replaced
1162:aadda3d1653c 1163:e7728b2522b2
  2112 
  2112 
  2113 (defun my-vc-root-diff (prefix)
  2113 (defun my-vc-root-diff (prefix)
  2114   "Same as `vc-root-diff' but for Hg with C-u show latest MQ patch and
  2114   "Same as `vc-root-diff' but for Hg with C-u show latest MQ patch and
  2115 with C-u C-u show MQ patch and local changes."
  2115 with C-u C-u show MQ patch and local changes."
  2116   (interactive "P")
  2116   (interactive "P")
  2117   (if (and prefix (eq (vc-deduce-backend) 'Hg) (eq (vc-hg-command nil t "." "log" "-r" "qparent") 0))
  2117   (when (eq 'non-hg-mq
  2118       (let* ( (rootdir (vc-call-backend 'Hg 'root default-directory)) (default-directory rootdir) )
  2118             (catch 'break
  2119         (cond
  2119               (unless (and prefix (eq (vc-deduce-backend) 'Hg))
  2120          ((equal prefix '(4))
  2120                 (throw 'break 'non-hg-mq))
  2121           (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" "qtip"))
  2121               (let* ( (rootdir (vc-call-backend 'Hg 'root default-directory)) (default-directory rootdir) )
  2122          ((equal prefix '(16))
  2122                 (unless (eq (vc-hg-command nil t rootdir "log" "-r" "qtip") 0)
  2123           (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" nil)) ))
  2123                   (throw 'break 'non-hg-mq))
  2124     (call-interactively 'vc-root-diff nil)))
  2124                 (cond
       
  2125                  ((equal prefix '(4))
       
  2126                   (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" "qtip"))
       
  2127                  ((equal prefix '(16))
       
  2128                   (vc-diff-internal t (list 'Hg (list rootdir)) "qparent" nil)) ))))
       
  2129     (call-interactively 'vc-root-diff nil) ))
  2125 
  2130 
  2126 (global-set-key (kbd "C-x v D") 'my-vc-root-diff)
  2131 (global-set-key (kbd "C-x v D") 'my-vc-root-diff)
  2127 
  2132 
  2128 (when (equal window-system 'w32)
  2133 (when (equal window-system 'w32)
  2129   (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))
  2134   (modify-coding-system-alist 'process "cvs" '(cp1251-dos . cp1251-dos))