##// END OF EJS Templates
revlog: make sure we never use sparserevlog without general delta (issue6056)...
revlog: make sure we never use sparserevlog without general delta (issue6056) We are getting user report where the delta code tries to use `sparse-revlog` logic on repository where `generaldelta` is disabled. This can't work so we ensure the two booleans have a consistent value. Creating this kind of repository is not expected to be possible the current bug report point at a clonebundle related bug that is still to be properly isolated (Yuya Nishihara seems to a have done it). Corrupting a repository to reproduce the issue is possible. A test using this method is included in this fix.

File last commit:

r22125:7fce964b default
r41525:189e06b2 stable
Show More
hg-test-mode.el
56 lines | 1.9 KiB | text/x-common-lisp | EmacsLispLexer
;; 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)