contrib/vim/hgtest.vim
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Sat, 15 Apr 2017 02:54:36 +0200
changeset 32018 090fff9b6d65
parent 18052 6db1642288c0
permissions -rw-r--r--
obsolescence: add test for the "branch replacement" logic during push, case D7 Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This changeset adds test for the improved "branch replacement" logic introduce in an earlier commits. This tests initially lived in the evolve extensions. Since we now have the code handling this logic in core, it make sense to have the tests in core too. See inline documentation for details about the test case added in this changeset.

" Vim syntax file
" Language: Mercurial unified tests
" Author: Steve Losh (steve@stevelosh.com)
"
" Place this file in ~/.vim/syntax/ and add the following line to your
" ~/.vimrc to enable:
" au BufNewFile,BufRead *.t set filetype=hgtest
"
" If you want folding you'll need the following line as well:
" let hgtest_fold=1
"
" You might also want to set the starting foldlevel for hgtest files:
" autocmd Syntax hgtest setlocal foldlevel=1

if exists("b:current_syntax")
  finish
endif

syn include @Shell syntax/sh.vim

syn match hgtestComment /^[^ ].*$/
syn region hgtestOutput start=/^  [^$>]/ start=/^  $/ end=/\v.(\n\n*[^ ])\@=/me=s end=/^  [$>]/me=e-3 end=/^$/ fold containedin=hgtestBlock
syn match hgtestCommandStart /^  \$ / containedin=hgtestCommand
syn region hgtestCommand start=/^  \$ /hs=s+4,rs=s+4 end=/^  [^>]/me=e-3 end=/^  $/me=e-2 containedin=hgtestBlock contains=@Shell keepend
syn region hgtestBlock start=/^  /ms=e-2 end=/\v.(\n\n*[^ ])\@=/me=s end=/^$/me=e-1 fold keepend

hi link hgtestCommandStart Keyword
hi link hgtestComment Normal
hi link hgtestOutput Comment

if exists("hgtest_fold")
  setlocal foldmethod=syntax
endif

syn sync match hgtestSync grouphere NONE "^$"
syn sync maxlines=200

" It's okay to set tab settings here, because an indent of two spaces is specified
" by the file format.
setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab

let b:current_syntax = "hgtest"