view contrib/hg-test-mode.el @ 23524:a1a7c94def6d

merge: don't report progress for dr/rd actions It is easier to reason about certain algorithms in terms of a file->action mapping than the current action->list-of-files. Bid merge is already written this way (but with a list of actions per file), and largefiles' overridecalculateupdates() will also benefit. However, that requires us to have at most one action per file. That requirement is currently violated by 'dr' (divergent rename) and 'rd' (rename and delete) actions, which can exist for the same file as some other action. These actions are only used for displaying warnings to the user; they don't change anything in the working copy or the dirstate. In this way, they are similar to the 'k' (keep) action. However, they are even less action-like than 'k' is: 'k' at least describes what to do with the file ("do nothing"), while 'dr' and 'rd' or only annotations for files for which there may exist other, "real" actions. As a first step towards separating these acitons out, stop including them in the progress output, just like we already exclude the 'k' action.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 05 Dec 2014 16:13:26 -0800
parents 7fce964be27d
children b6a757de2fff
line wrap: on
line source

;; hg-test-mode.el - Major mode for editing Mercurial tests
;;
;; Copyright 2014 Matt Mackall <mpm@selenic.com>
;; "I have no idea what I'm doing"
;;
;; This software may be used and distributed according to the terms of the
;; GNU General Public License version 2 or any later version.
;;
;; To enable, add something like the following to your .emacs:
;;
;; (if (file-exists-p "~/hg/contrib/hg-test-mode.el")
;;    (load "~/hg/contrib/hg-test-mode.el"))

(defvar hg-test-mode-hook nil)

(defvar hg-test-mode-map
  (let ((map (make-keymap)))
    (define-key map "\C-j" 'newline-and-indent)
    map)
  "Keymap for hg test major mode")

(add-to-list 'auto-mode-alist '("\\.t\\'" . hg-test-mode))

(defconst hg-test-font-lock-keywords-1
  (list
   '("^  \\(\\$\\|>>>\\) " 1 font-lock-builtin-face)
   '("^  \\(>\\|\\.\\.\\.\\) " 1 font-lock-constant-face)
   '("^  \\([[][0-9]+[]]\\)$" 1 font-lock-warning-face)
   '("^  \\(.*?\\)\\(\\( [(][-a-z]+[)]\\)*\\)$" 1 font-lock-string-face)
   '("\\$?\\(HG\\|TEST\\)\\w+=?" . font-lock-variable-name-face)
   '("^  \\(.*?\\)\\(\\( [(][-a-z]+[)]\\)+\\)$" 2 font-lock-type-face)
   '("^#.*" . font-lock-preprocessor-face)
   '("^\\([^ ].*\\)$" 1 font-lock-comment-face)
   )
  "Minimal highlighting expressions for hg-test mode")

(defvar hg-test-font-lock-keywords hg-test-font-lock-keywords-1
  "Default highlighting expressions for hg-test mode")

(defvar hg-test-mode-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?\" "w" st) ;; disable standard quoting
    st)
"Syntax table for hg-test mode")

(defun hg-test-mode ()
  (interactive)
  (kill-all-local-variables)
  (use-local-map hg-test-mode-map)
  (set-syntax-table hg-test-mode-syntax-table)
  (set (make-local-variable 'font-lock-defaults) '(hg-test-font-lock-keywords))
  (setq major-mode 'hg-test-mode)
  (setq mode-name "hg-test")
  (run-hooks 'hg-test-mode-hook))

(provide 'hg-test-mode)