Mercurial > hg
annotate contrib/vim/hgtest.vim @ 13155:f02d7a562a21
subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)
This patch avoids empty commit when .hgsubstate is dirty. Empty commit
was caused by .hgsubstate being updated back to the state of the
working copy parent when committing, if a user had changed it manually
and not made any changes in subrepositories.
The subrepository state from the working copies parent is compared
with the state calculated as a result of trying to commit the
subrepositories. If the two states are the same, then return None
otherwise the commit is just done.
The line: "committing subrepository x" will be written if there is
nothing committed, but .hgsubstate is dirty for x subrepository.
author | Erik Zielke <ez@aragost.com> |
---|---|
date | Mon, 29 Nov 2010 09:37:23 +0100 |
parents | 4746a2e4b239 |
children | 6db1642288c0 |
rev | line source |
---|---|
12509
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
1 " Vim syntax file |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
2 " Language: Mercurial unified tests |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
3 " Author: Steve Losh (steve@stevelosh.com) |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
4 " |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
5 " Add the following line to your ~/.vimrc to enable: |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
6 " au BufNewFile,BufRead *.t set filetype=hgtest |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
7 " |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
8 " If you want folding you'll need the following line as well: |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
9 " let hgtest_fold=1 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
10 " |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
11 " You might also want to set the starting foldlevel for hgtest files: |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
12 " autocmd Syntax hgtest setlocal foldlevel=1 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
13 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
14 if exists("b:current_syntax") |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
15 finish |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
16 endif |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
17 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
18 syn include @Shell syntax/sh.vim |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
19 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
20 syn match hgtestComment /^[^ ].*$/ |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
21 syn region hgtestOutput start=/^ [^$>]/ start=/^ $/ end=/\v.(\n\n*[^ ])\@=/me=s end=/^ [$>]/me=e-3 end=/^$/ fold containedin=hgtestBlock |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
22 syn match hgtestCommandStart /^ \$ / containedin=hgtestCommand |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
23 syn region hgtestCommand start=/^ \$ /hs=s+4,rs=s+4 end=/^ [^>]/me=e-3 end=/^ $/me=e-2 containedin=hgtestBlock contains=@Shell keepend |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
24 syn region hgtestBlock start=/^ /ms=e-2 end=/\v.(\n\n*[^ ])\@=/me=s end=/^$/me=e-1 fold keepend |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
25 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
26 hi link hgtestCommandStart Keyword |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
27 hi link hgtestComment Normal |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
28 hi link hgtestOutput Comment |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
29 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
30 if exists("hgtest_fold") |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
31 setlocal foldmethod=syntax |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
32 endif |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
33 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
34 syn sync match hgtestSync grouphere NONE "^$" |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
35 syn sync maxlines=200 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
36 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
37 " It's okay to set tab settings here, because an indent of two spaces is specified |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
38 " by the file format. |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
39 setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
40 |
4746a2e4b239
contrib/vim: add a syntax file for unified tests
Steve Losh <steve@stevelosh.com>
parents:
diff
changeset
|
41 let b:current_syntax = "hgtest" |