Commits

ZyX_I  committed e7a6d2c

Moved testrepo copying to gentests-setuprepos.zsh
Added :WT (WriteTip) command and made commit test use it

  • Participants
  • Parent commits 16c962e

Comments (0)

Files changed (8)

File test/annotate-buffers.in

-:call mkdir(g:curtest.'repo')
-:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
 :W{{{1 file
 :silent edit `=g:curtest.'repo/chgrepo.zsh'`
 :AuAnnotate

File test/commit.in

-:call mkdir(g:curtest.'repo')
-:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
 :W{{{1
 :R silent edit nohglinesrev.lst
 :AuCommit
 Abc:silent write
-:R AuGlog revrange tip tip
-:setlocal modifiable noreadonly
-:g/Commited/delete _
-:normal! gg0f:"_d$
-:call WriteFile(getline(1, line('$')-1))
-:bwipeout!
+:WT
 :W{{{1 message
 :call append('$', 'New text')
 :silent write
 :AuCommit message Def\ ghi
-:R AuGlog revrange tip tip
-:setlocal modifiable noreadonly
-:g/Commited/delete _
-:normal! gg0f:"_d$
-:call WriteFile(getline(1, line('$')-1))
-:bwipeout!
+:WT
 :W{{{1 message+user+date
 :call append('$', 'New text 2')
 :silent write
 :AuCommit message Def\ ghi user A\ <a@example.com> date 2007-08-11_6:00
-:R AuGlog revrange tip tip
-:setlocal modifiable noreadonly
-:normal! gg0f:"_d$
-:call WriteFile(getline(1, line('$')-1))
-:bwipeout!
-:source addmessages.vim
+:WT!

File test/gentests-setuptestrepo.zsh

-#!/bin/zsh
-emulate -L zsh
-tar xJf testrepo.tar.xz

File test/gentests-setuptestrepos.zsh

+#!/bin/zsh
+emulate -L zsh
+tar xJf testrepo.tar.xz
+
+for test in annotate-buffers commit record stat statmaps vimdiff ; do
+    mkdir ${test}repo
+    tar c -C testrepo . | (cd ${test}repo && tar x)
+done

File test/stat.in

-:call mkdir(g:curtest.'repo')
-:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
 :W{{{1
 :Run AuStatus
 :bwipeout!

File test/statmaps.in

-:call mkdir(g:curtest.'repo')
-:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
 :W{{{1 <CR>
 :silent cd `=g:curtest.'repo'`
 :AuStatus

File test/vimdiff.in

-:call mkdir(g:curtest.'repo')
-:execute '!tar c -C testrepo . | (cd '.g:curtest.'repo && tar x)'
 :W{{{1 status
 :R AuStatus
 /^M
     return ''
 endfunction
 command -nargs=1 -bar W call WriteFile(<q-args>)
+function s:WriteTip(writecom)
+    R AuGlog revrange tip tip
+    setlocal modifiable noreadonly
+    if !a:writecom
+        g/Commited/delete _
+    endif
+    normal! gg0f:"_d$
+    call WriteFile(getline(1, line('$')-1))
+    bwipeout!
+endfunction
+command -nargs=0 -bar -bang WT :call s:WriteTip(<bang>0)