Commits

ZyX_I committed 87d1812

Added :AuGrep workmatch option
Added prevbuf saving, made prevbuf key generation more smart
Made aurum#* functions return empty dictionary on failure.
Made non-python driver use single call to log with custom template file
instead of a number of different calls used by getcsprop
Moved bufhidden setting to :Au* commands

Comments (0)

Files changed (18)

             \               '@aurum/cache': '0.0',})
 "▶1 aurum#repository
 function aurum#repository()
-    return s:_r.cache.get('repo', s:_r.repo.get, [':'], {})
+    let repo=s:_r.cache.get('repo', s:_r.repo.get, [':'], {})
+    if repo is 0
+        return {}
+    endif
+    return repo
 endfunction
 let s:_functions+=['aurum#repository']
 "▶1 aurum#changeset
 function aurum#changeset(...)
     let repo=((a:0)?(a:1):(aurum#repository()))
+    if empty(repo)
+        return {}
+    endif
     return s:_r.cache.get('cs', repo.functions.getcs, [repo, '.'], {})
 endfunction
 let s:_functions+=['aurum#changeset']
 "▶1 aurum#status
 function aurum#status(...)
     let repo=((a:0)?(a:1):(aurum#repository()))
+    if empty(repo)
+        return {}
+    endif
     return get(keys(filter(copy(s:_r.cache.get('status', repo.functions.status,
                 \                              [repo, 0, 0,
                 \                               [repo.functions.reltorepo(repo,
     [no]wdfiles    Flag. Determines whether :AuGrep should output files in 
                    working directory if they have not changed since found 
                    revision. Overrides |g:aurum_workdirfiles|.
+    [no]workmatch  Flag. When processing `files' option if this flag is true 
+                   (default) it will grep only files present in working 
+                   directory changeset. If this flag is false, :AuGrep will 
+                   process all changesets in order to find out files matching 
+                   pattern(s) given in `files' option.
 
                                                                 *:AuHyperlink*
 AuHyperlink [rev {rev}] [file {file}] [line {line}] [cmd {cmd}] [repo {repo}]
+"▶1 
+scriptencoding utf-8
+if !has('folding')
+    finish
+endif
+if !exists('s:_sid')
+    function s:Eval(expr)
+        return eval(a:expr)
+    endfunction
+    let s:_sid=matchstr(s:Eval('expand("<sfile>")'), '\v\d+')
+endif
+let &l:foldexpr='<SNR>'.s:_sid.'_FoldExpr()'
+let &l:foldtext='<SNR>'.s:_sid.'_FoldText()'
+"▶1 foldexpr
+function! s:FoldExpr()
+    let line=getline(v:lnum)
+    let nextline=getline(v:lnum+1)
+    if line[:4] is# 'diff '
+        return 1
+    elseif nextline[:4] is# 'diff '
+        return '<1'
+    elseif line[:2] is# '@@ '
+        return 2
+    elseif nextline[:2] is# '@@ '
+        return '<2'
+    endif
+    return '='
+endfunction
+"▶1 foldtext
+function! s:FoldText()
+    let line=getline(v:foldstart)
+    if v:foldlevel==1
+        if line =~# '\v^diff\ a\/(.{-})\ b\/\1'
+            return matchlist(line, '\v^diff\ a\/(.{-})\ b\/\1')[1]
+        elseif line =~# '\v^diff%(\ \-r\ \x+){1,2}'
+            return substitute(line, '\v^diff%(\ \-r\ \x+){1,2}\ ', '', '')
+        endif
+    elseif v:foldlevel==2
+        return substitute(line, '\m^@@[^@]\+@@ ', '', '')
+    endif
+endfunction
+"▶1
+" vim: ft=vim ts=4 sts=4 et fmr=▶,▲

misc/map-cmdline.csinfo

+changeset = ':\n{rev}\n{node}\n{branch}\n{date}\n{author}\n{parents}{tags}{bookmarks}{files}{file_dels}{file_copies}\t{desc|tabindent}\n'
+parent    = 'P{node}\n'
+tag       = 'T{tag}\n'
+bookmark  = 'B{bookmark}\n'
+file      = 'C{file}\n'
+file_del  = 'R{file_del}\n'
+file_copy = 'D{name}\n{source}\n'

misc/map-cmdline.files

-changeset = '{files}{file_dels}{file_copies}'
-file      = 'F{file}\n'
-file_del  = 'R{file_del}\n'
-file_copy = 'D{name}\nS{source}\n'
                 \                 ])
     "▶2 Global mappings
     call FraworLoad('@/mappings')
+    " TODO mapping that closes status window
     call s:_f.mapgroup.add('Aurum', {
                 \'Commit':    {'lhs':  'i', 'rhs': ':<C-u>AuCommit<CR>'          },
                 \'CommitAll': {'lhs':  'I', 'rhs': ':<C-u>AuCommit **<CR>'       },
     "▲2
     setlocal buftype=nofile readonly
     let buf=bufnr('%')
+    if has_key(s:_r.bufvars, buf) &&
+                \has_key(s:_r.bufvars[buf], 'prevbuf')
+        let prevbuf=s:_r.bufvars[buf].prevbuf
+    endif
     setlocal modifiable
     " FIXME This code is creating repository object for the second time
     "▶2 log command (repo:opts)
         call s:_r.log.setup(bvar)
         if !a:read
             let s:_r.bufvars[buf]=bvar
-            setlocal filetype=aurumlog bufhidden=wipe
+            setlocal filetype=aurumlog
             runtime ftplugin/aurumlog.vim
         endif
     "▶2 file command (repo:rev:file)
         call s:_r.annotate.setup(bvar)
         if !a:read
             let s:_r.bufvars[buf]=bvar
-            setlocal filetype=aurumannotate bufhidden=wipe
+            setlocal filetype=aurumannotate
             runtime ftplugin/aurumannotate.vim
         endif
     "▶2 diff command (repo:rev1:rev2:files:opts)
         call s:_r.status.setup(bvar)
         if !a:read
             let s:_r.bufvars[buf]=bvar
-            setlocal filetype=aurumstatus bufhidden=wipe
+            setlocal filetype=aurumstatus
             runtime ftplugin/aurumstatus.vim
         endif
     "▶2 commit command  (repo:user:date:files)
                         \ | call feedkeys("\<C-\>\<C-n>:bwipeout!\n")
         augroup END
         setlocal buftype=acwrite
-        setlocal filetype=aurumcommit bufhidden=wipe
+        setlocal filetype=aurumcommit
         runtime ftplugin/aurumcommit.vim
     "▶2 copy command (file)
     elseif command is# 'copy'
     "▲2
     if !a:read
         let s:_r.bufvars[buf].command=command
+        if exists('prevbuf')
+            let s:_r.bufvars[buf].prevbuf=prevbuf
+        endif
     endif
     file
 endfunction
             \substitute(s:tracfunc['@FWC'][0],
             \'\V+ type ""', '+ (path)', ''))
 "▶1 hypfunc
-" TODO bundleurl ?
+" TODO bundle, raw urls ?
+" TODO clone url
 function s:hypfunc.function(opts)
     let [hasbuf, repo, rev, file]=s:_r.cmdutils.getrrf(a:opts, 'nocurf', 0)
     call s:_r.cmdutils.checkrepo(repo)
     let files=[]
     if has_key(a:opts, 'files')
         if empty(revisions)
-            call repo.functions.getchangesets(repo)
-            let cslist=repo.cslist
+            if get(a:opts, 'workmatch', 1)
+                let cslist=[repo.functions.getcs(repo, repo.work_hex)]
+            else
+                call repo.functions.getchangesets(repo)
+                let cslist=repo.cslist[:-2]
+            endif
         else
             let cslist=[]
             for r in revisions
             \           ' ?*+2 revrange   type ""  type ""'.
             \           ' ?*   revision   type ""'.
             \           ' ?*   files      type ""'.
+            \           ' ?   !workmatch'.
             \           ' ?   !wdfiles'.
             \           ' ?   !ignorecase '.
             \           '}', 'filter']

plugin/aurum/annotate.vim

     execute 'silent leftabove 42vsplit '.
                 \fnameescape('aurum://annotate:'.epath.':'.rev.':'.file)
     setlocal scrollbind
+    setlocal bufhidden=wipe
     let buf=bufnr('%')
     call s:F.setannbuf(s:_r.bufvars[buf], buf, annbuf)
 endfunction

plugin/aurum/cmdutils.vim

     if has_key(a:bvar, 'prevbuf') && bufexists(a:bvar.prevbuf)
         let r.=':buffer '.a:bvar.prevbuf."\n"
     endif
-    return r.':bwipeout '.bufnr('%')."\n"
+    let buf=bufnr('%')
+    return r.':if bufexists('.buf.')|bwipeout '.buf."|endif\n"
+endfunction
+"▶1 getprevbuf :: () + bufvars → buf
+function s:F.prevbuf()
+    let r=bufnr('%')
+    if has_key(s:_r.bufvars, r) && (&bufhidden is# 'wipe' ||
+                \                   &bufhidden is# 'delete') &&
+                \has_key(s:_r.bufvars[r], 'prevbuf')
+        let r=s:_r.bufvars[r].prevbuf
+    endif
+    return r
 endfunction
 "▶1 Post cmdutils resource
 call s:_f.postresource('cmdutils', {'globtopat': s:F.globtopattern,
             \                       'checkrepo': s:F.checkrepo,
             \                        'setlines': s:F.setlines,
             \                        'closebuf': s:F.closebuf,
+            \                         'prevbuf': s:F.prevbuf,
             \                    'nogetrepoarg': s:nogetrepoarg,
             \})
 "▶1 Some completion-related globals

plugin/aurum/diff.vim

                 \                    'index(s:_r.repo.diffoptslst, v:key)!=-1'))
     let epath=escape(repo.path, ':\')
     let efiles=join(map(filelist, 'escape(v:val, "\\;:")'), ';')
-    let prevbuf=bufnr('%')
+    let prevbuf=s:_r.cmdutils.prevbuf()
     execute get(a:opts, 'cmd', 'silent edit')
                 \ fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.
                 \                         ':'.efiles.':'.opts)
     if !has_key(a:opts, 'cmd')
         let s:_r.bufvars[bufnr('%')].prevbuf=prevbuf
+        setlocal bufhidden=wipe
+        if has('folding')
+            setlocal foldmethod=expr
+        endif
     endif
     call s:_f.mapgroup.map('AuDiff', bufnr('%'))
 endfunction

plugin/aurum/drivers/mercurial.vim

                 \             'for the repository %s: %s',
                 \ 'stat1mis': 'You must specify first revision as well',
             \})
+    let s:nullrev=repeat('0', 40)
 endif
 "▶1 s:hypsites
 " len("hgroot")=6
 endfunction
 "▲2
 else "▶1
-let s:cstemplate='{rev}:{node}:{branch}\n'.
-            \    '{parents}-{date}:{author}\n'.
-            \    '{desc|tabindent}\n'
-let s:cstemplate=shellescape(s:cstemplate, 1)
-let s:nullrev=repeat('0', 40)
 "▶2 addchangesets :: repo, [cs] → _ + repo
 function s:F.addchangesets(repo, css)
     call map(copy(a:css), 'extend(a:repo.changesets, {v:val.hex : v:val})')
     return r
 endfunction
 "▶2 parsecs :: csdata, lstart::UInt → [cs, line::UInt]
+let s:stylefile=shellescape(s:_r.os.path.join(s:_frawor.runtimepath,
+                \                             'misc', 'map-cmdline.csinfo'))
+let s:chars=[['P', 'parents'],
+            \['T', 'tags'],
+            \['B', 'bookmarks'],
+            \['C', 'changes'],
+            \['R', 'removes']]
 function s:F.parsecs(csdata, lstart)
+    "▶3 Initialize variables, check for changeset start
     let cs={}
     let line=a:lstart
-    "▶3 First line (rev, hex, branch)
-    let match=matchlist(a:csdata[line], '\v^(\d+|\-1)\:(\x+)\:(.*)$')
-    if empty(match)
+    let lcsdata=len(a:csdata)
+    if lcsdata<6 || a:csdata[line] isnot# ':'
         call s:_f.throw('parsefail')
     endif
-    let cs.rev=str2nr(match[1])
-    let cs.hex=match[2]
-    let cs.branch=match[3]
     let line+=1
-    "▶3 Second line (parents, date, author)
-    let match=matchlist(a:csdata[line],
-                \       '\v^([^\-]*)\-(\d+)%(\.\d+%(\-\d+)?)?\:(.*)$')
-    if empty(match)
-        call s:_f.throw('parsefail')
-    endif
-    if empty(match[1])
+    "▶3 Simple keys: rev, hex, branch, time, user
+    let cs.rev    = str2nr(a:csdata[line]) | let line+=1
+    let cs.hex    = a:csdata[line]         | let line+=1
+    let cs.branch = a:csdata[line]         | let line+=1
+    let cs.time   = str2nr(a:csdata[line]) | let line+=1
+    let cs.user   = a:csdata[line]         | let line+=1
+    "▶3 List keys: parents, tags, bookmarks, changes, removes
+    for [char, key] in s:chars
+        let cs[key]=[]
+        while line<lcsdata && a:csdata[line][0] is# char
+            let cs[key]+=[a:csdata[line][1:]]
+            let line+=1
+        endwhile
+    endfor
+    "▶3 Add data to cs.parents in case it is empty
+    if empty(cs.parents)
         if cs.rev>0
             let cs.parents=[cs.rev-1]
         else
             let cs.parents=[s:nullrev]
         endif
-    else
-        " XXX str2nr('123:1f6de') will return number 123
-        let cs.parents=map(split(match[1]), 'str2nr(v:val)')
     endif
-    let cs.time=str2nr(match[2])
-    let cs.user=match[3]
-    let line+=1
-    "▶3 Following lines (description)
-    let desc=a:csdata[line]
-    let line+=1
-    let lcsdata=len(a:csdata)
+    "▶3 Filter cs.removes, add cs.files
+    call filter(cs.removes, 'index(cs.changes, v:val)!=-1')
+    let cs.files=filter(copy(cs.changes), 'index(cs.removes, v:val)==-1')
+    "▶3 Copies, renames
+    let copies={}
+    while line<lcsdata && a:csdata[line][0] is# 'D'
+        let copies[a:csdata[line][1:]]=a:csdata[line+1]
+        let line+=2
+    endwhile
+    let cs.copies  = filter(copy(copies), 'index(cs.removes, v:val)==-1')
+    let cs.renames = filter(copy(copies), '!has_key(cs.copies, v:key)')
+    "▶3 Description
+    let description=[]
     while line<lcsdata && a:csdata[line][0] is# "\t"
-        let desc.="\n".a:csdata[line][1:]
+        let description+=[a:csdata[line][1:]]
         let line+=1
     endwhile
-    let cs.description=desc
+    let cs.description=join(description, "\n")
     "▲3
-    let cs.tags=[]
-    let cs.bookmarks=[]
     return [cs, line]
 endfunction
 "▶2 getcslist :: repo, start, end
 function s:F.getcslist(repo, start, end)
-    let logbeg='log --template '.s:cstemplate.' '
+    let logbeg='log --style '.s:stylefile.' '
     let lines=s:F.hg(a:repo, logbeg.'-r '.a:start.'..'.a:end, 0, 'log')[:-2]
     let css=[]
     if has_key(a:repo.changesets, s:nullrev)
         for key in ['tags', 'bookmarks']
             let list=s:F.getkeylist(a:repo, key)
             let r[key]={}
-            for [name, rev] in list
-                if rev<a:start
-                    let r[key][name]=a:repo.cslist[rev].hex
-                else
-                    " let r[key][name]=r.css[rev-a:start].hex
-                    let cs=r.css[rev-a:start]
-                    let cs[key]=get(cs, key, [])+[name]
-                    call sort(cs[key])
-                endif
+            for [name, rev] in filter(copy(list), 'v:val[1]<'.a:start)
+                let r[key][name]=a:repo.cslist[rev].hex
             endfor
         endfor
         let a:repo.csnum=a:start+len(r.css)
     let repo={'path': a:path, 'changesets': {}, 'cslist': [],
                 \'local': (stridx(a:path, '://')==-1),
                 \'functions': copy(s:hg),}
-    let repo.work_hex=s:hg.getrevhex(repo, '.')
+    try
+        let repo.work_hex=s:hg.getrevhex(repo, '.')
+    catch
+        return 0
+    endtry
     let tipcs=s:hg.getcs(repo, 'tip')
     let repo.tip_hex=tipcs.hex
     let repo.csnum=tipcs.rev+2
     endtry
 endfunction
 else "▶3
-"▶4 getrfc :: repo, cs[, _] → _ + cs
-let s:erfcstylefile=shellescape(s:_r.os.path.join(s:_frawor.runtimepath,
-                \                                 'misc', 'map-cmdline.files'))
-function s:F.getrfc(repo, cs, ...)
-    if has_key(a:cs, 'gotrenames')
-        return
-    endif
-    if a:cs.rev==0
-        let a:cs.renames={}
-        let a:cs.copies={}
-        " First changeset cannot contain removed files. All files present in 
-        " this changeset were added by it.
-        let allfiles=a:repo.functions.getcsprop(a:repo, a:cs, 'allfiles')
-        let a:cs.files=allfiles
-        let a:cs.changes=allfiles
-        let a:cs.removes=[]
-    else
-        let slines=s:F.hg(a:repo, 'log --rev '.a:cs.rev.' '.
-                    \     '--style '.s:erfcstylefile, 0,
-                    \     'ren', a:cs.rev)[:-2]
-        let files=[]
-        let removes=[]
-        let copies={}
-        let prevfile=0
-        for line in slines
-            let s=line[0]
-            let file=line[1:]
-            if s is# 'F'
-                let files+=[file]
-            elseif s is# 'R'
-                let removes+=[file]
-            elseif s is# 'D'
-                let prevfile=file
-            elseif s is# 'S'
-                let copies[prevfile]=file
-            endif
-        endfor
-        let a:cs.copies  = filter(copy(copies), 'index(removes, v:val)==-1')
-        let a:cs.renames = filter(copy(copies), '!has_key(a:cs.copies, v:key)')
-        let a:cs.files   = filter(copy(files), 'index(removes, v:val)==-1')
-        let a:cs.changes = files
-        let a:cs.removes = filter(copy(files), 'index(removes, v:val)!=-1')
-    endif
-    lockvar! a:cs.renames a:cs.copies a:cs.files a:cs.changes a:cs.removes
-    let a:cs.gotrenames=1
-    lockvar a:cs.gotrenames
-endfunction
-"▲4
 function s:F.setcsprop(repo, cs, propname)
     if a:propname is# 'allfiles'
         let r=s:F.hg(a:repo, 'manifest -r '.a:cs.rev, 0,
                     \'csp', a:propname, a:cs.rev)[:-2]
-    elseif a:propname is# 'changes' || a:propname is# 'files' ||
-                \a:propname is# 'removes'
-        call s:F.getrfc(a:repo, a:cs)
-        return a:cs[a:propname]
     elseif a:propname is# 'children'
         " XXX str2nr('123:1f6de') will return number 123
         let r=map(split(s:F.hg(a:repo, 'log -r '.a:cs.rev.' --template '.
     else
         let cs=a:repo.functions.getcs(a:repo, a:csr)
     endif
-    if a:propname is# 'renames' || a:propname is# 'copies'
-        return s:F.renamed(a:repo, cs)
-    endif
     if has_key(cs, a:propname)
         return cs[a:propname]
     endif
 endfunction
 else "▶3
 function s:F.getcs(repo, hex)
-    let csdata=s:F.hg(a:repo, 'log -r '.a:hex.' --template '.s:cstemplate, 0,
+    let csdata=s:F.hg(a:repo, 'log -r '.a:hex.' --style '.s:stylefile, 0,
                 \     'cs', a:hex)
     let cs=s:F.parsecs(csdata, 0)[0]
-    call map(cs.parents, 'a:repo.functions.getrevhex(a:repo, v:val)')
+    call map(cs.parents,
+                \'type(v:val)=='.type(0).'? '.
+                \   'a:repo.functions.getrevhex(a:repo, v:val): '.
+                \   'v:val')
     return cs
 endfunction
 endif
         return cs
     endif
 endfunction
-"▶1 renamed :: repo, cs → {file : Maybe String}
-if s:usepythondriver "▶2
-function s:F.renamed(repo, cs)
-    try
-        execute s:_r.py.cmd 'aurum.get_renames(vim.eval("a:repo.path"), '.
-                    \                         'vim.eval("a:cs.hex"))'
-    endtry
-endfunction
-else "▶2
-let s:F.renamed=s:F.getrfc
-endif
 "▶1 diffopts :: opts → diffopts
 let s:diffopts={
             \      'git': 'git',

plugin/aurum/file.vim

     if hasbuf
         let filetype=&filetype
     endif
-    let prevbuf=bufnr('%')
+    let prevbuf=s:_r.cmdutils.prevbuf()
     execute get(a:opts, 'cmd', 'silent edit')
                 \ fnameescape('aurum://file:'.epath.':'.rev.':'.file)
     if exists('filetype') && &filetype isnot# filetype
     endif
     if !has_key(a:opts, 'cmd')
         let s:_r.bufvars[bufnr('%')].prevbuf=prevbuf
+        setlocal bufhidden=wipe
     endif
     call s:_f.mapgroup.map('AuFile', bufnr('%'))
 endfunction
 let s:kwexpr.tags        = [0, 'join(@@@, @0@)', ', ']
 let s:kwexpr.bookmarks   = [0, 'join(@@@, @0@)', ', ']
 let s:kwexpr.summary     = [0, '@@@']
+" TODO Add tab expansion
 let s:kwexpr.description = [1, 'split(@@@, "\n")']
 let s:kwexpr.patch       = [1, '@@@']
 let s:kwexpr.stat        = [2, 's:F.temp.stat(@@@, a:cs.files, @<@)']
     let optsstr=s:_r.cmdutils.encodeopts(opts)
     let epath=escape(repo.path, ':\')
     execute cmd fnameescape('aurum://log:'.epath.':'.optsstr)
+    if !has_key(opts, 'cmd')
+        setlocal bufhidden=wipe
+    endif
 endfunction
 let s:datereg='%(\d\d%(\d\d)?|[*.])'.
             \ '%(\-%(\d\d?|[*.])'.

plugin/aurum/record.vim

     endif
     execute 'silent botright '.height.' split '.
                 \fnameescape('aurum://status:'.epath.':'.opts)
+    setlocal bufhidden=wipe
     let w:aurecid='AuRecordStatus'
     setlocal nomodifiable
     call s:_f.mapgroup.map('AuRecord', bufnr('%'))

plugin/aurum/status.vim

                     \       (winheight(0)!=lnum && lnum<(&lines/3)))
             execute 'resize' lnum
         endif
+        setlocal bufhidden=wipe
     endif
 endfunction
 let s:statfunc['@FWC']=['-onlystrings '.

plugin/aurum/vimdiff.vim

     if (a:usewin==-1 ? s:_f.getoption('usewin') : a:usewin) && winnr('$')>1
         diffthis
         if s:F.findwindow()
-            let prevbuf=bufnr('%')
+            let prevbuf=s:_r.cmdutils.prevbuf()
             execute 'silent edit' fnameescape(a:difftarget)
             diffthis
         else
         let fbuf=bufnr('%')
     else
         let t:auvimdiff_prevbuffers={}
-        let prevbuf=bufnr('%')
+        let prevbuf=s:_r.cmdutils.prevbuf()
         if frev is 0
             execute 'silent edit' fnameescape(s:_r.os.path.join(repo.path,file))
         else
             if !i && usewin && winnr('$')>1
                 diffthis
                 if s:F.findwindow()
-                    let prevbuf=bufnr('%')
+                    let prevbuf=s:_r.cmdutils.prevbuf()
                     execute 'silent edit' fnameescape(f)
                     diffthis
                     let t:auvimdiff_prevbuffers[bufnr('%')]=prevbuf
     except AurumError:
         pass
 
+def get_renames(cs):
+    def get_renames_value(rename):
+        return rename[0] if rename else 0
+    renames_vim={}
+    copies_vim={}
+    for f in cs:
+        fctx=g_fctx(cs, f)
+        rename=get_renames_value(fctx.renamed())
+        if rename:
+            if rename in cs:
+                copies_vim[f]=rename
+                renames_vim[f]=0
+            else:
+                copies_vim[f]=0
+                renames_vim[f]=rename
+        else:
+            copies_vim[f]=0
+            renames_vim[f]=0
+    vim.eval('extend(a:cs, '+nonutf_dumps({'renames': renames_vim,
+                                            'copies': copies_vim})+')')
+
 def get_cs_prop(path, rev, prop):
     try:
         cs=g_cs(g_repo(path), rev)
                                    '"removes": '+nonutf_dumps(r) +', '+
                                    '"changes": '+nonutf_dumps(c) +'})')
             return
+        elif prop=='renames' or prop=='copies':
+            get_renames(cs)
+            return
         elif prop=='allfiles':
             r=[f for f in cs]
         elif prop=='children':
     except AurumError:
         pass
 
-def get_renames(path, rev):
-    def get_renames_value(rename):
-        return rename[0] if rename else 0
-    try:
-        cs=g_cs(g_repo(path), rev)
-        renames_vim={}
-        copies_vim={}
-        for f in cs:
-            fctx=g_fctx(cs, f)
-            rename=get_renames_value(fctx.renamed())
-            if rename:
-                if rename in cs:
-                    copies_vim[f]=rename
-                    renames_vim[f]=0
-                else:
-                    copies_vim[f]=0
-                    renames_vim[f]=rename
-            else:
-                copies_vim[f]=0
-                renames_vim[f]=0
-        vim.eval('extend(a:cs, '+nonutf_dumps({'renames': renames_vim,
-                                                'copies': copies_vim})+')')
-    except AurumError:
-        pass
-
 def get_status(path, rev1=None, rev2=None, files=None):
     try:
         if rev1 is None and rev2 is None:
 :RG A\b repo ../testrepo
 :RG A\b files ../testrepo/nohglinesrev.lst
 :RG A\b revision 4 files ../testrepo/*.lst
-:RG A\b revision 2 files ../testrepo/*.lst
+:RG /bin/zsh noworkmatch files createrepo.zsh
+:RG /bin/zsh workmatch files createrepo.zsh
 :RG /bin/zsh nowdfiles
 :let g:aurum_workdirfiles=0
 :RG /bin/zsh
 %TMPDIR%/test/testrepo/hglines.lst|38| hg commit -A -m 'Added nohglinesrev.lst' \
 %TMPDIR%/test/testrepo/hglines.lst|39| hg commit -A -m 'Added ignored10.lst' \
 %TMPDIR%/test/testrepo/hglines.lst|40| hg commit -A -m 'Added .hgignore' \
-{{{1 A\b revision 2 files ../testrepo/*.lst
+{{{1 /bin/zsh noworkmatch files createrepo.zsh
+aurum://file:%TMPDIR%/test/greprepo:0:createrepo.zsh|1| #!/bin/zsh
+{{{1 /bin/zsh workmatch files createrepo.zsh
 {{{1 /bin/zsh nowdfiles
 aurum://file:%TMPDIR%/test/greprepo:19:nohglines.lst|1| #!/bin/zsh
 aurum://file:%TMPDIR%/test/greprepo:10:blines.lst|1| #!/bin/zsh