Commits

ZyX_I committed 56ea4f5

Now using new aurum:// arguments escape scheme
Some fixes to non-python driver that should make it work better on windows (its interaction with above change is untested)

  • Participants
  • Parent commits 87d1812

Comments (0)

Files changed (41)

File doc/aurum.txt

   backslashes and colons. If command accepts {diffopts} then they can also be 
   added.
   Options `cmd' and `repo' are always ignored.
+- All arguments for all pseudo-protocols except |aurum://copy| are assumed to 
+  be escaped in the following fashion:
+                 Char  Esc ~
+                    %  %%
+                    ,  %c
+                    :  %.
+                    ;  %s
+                    /  %-
+                    \  %+
+                  [,]  %b, %B
+                  {,}  %f, %F
+                    *  %a
+                    ?  %q
+                    `  %'
+                    $  %d
+  You must escape only argument delimiters (colon for most arguments, colon 
+  and comma for non-list option arguments, colon, semicolon and comma for list 
+  option arguments) and percent sign, but in this case you may run into 
+  trouble: for example, `*' produces |E480| (no match) error on windows 
+  because it can't be escaped with backslash which is path separator.
 - All mappings are created using |frawor-f-mapgroup.add| and thus can 
   customized using |g:frawormap_mgid| and |g:frawormap_mgid_mapname|.
 - All buffers that define mappings also define Exit mapping (with default 
                                                                *aurum-rf-grep*
   grep :: pattern, [ file ], [ Either hex (hex, hex) ], ic, wdf -> qflist
     Search repository for given pattern and return results in a list that can 
-    be passed to |setqflist()| function. Second argument here controls what 
-    files should be searched for. Third controls revisions that are to be 
-    searched (tuple variant: range of revisions). {ic} determines whether case 
-    should be ignored and {wdf} determines whether grep should output files in 
-    working directory if they have not changed since found revision.
+    be passed to |setqflist()| function with small modifications (see below). 
+    Second argument here controls what files should be searched for. Third 
+    controls revisions that are to be searched (tuple variant: range of 
+    revisions). {ic} determines whether case should be ignored and {wdf} 
+    determines whether grep should output files in working directory if they 
+    have not changed since found revision.
+    Note: If you want to use grep() directly, you should remember that 
+          `filename' key may contain either an absolute filename or pair 
+          (revision, filename (relative to repository root)). Second is to be 
+          transformed into |aurum://file| path.
                                                              *aurum-rf-status*
   status :: [hex[, hex[, [ file ]]]] -> {status : [ files ]}
     Returns dictionary where values are lists of files and keys are 

File ftplugin/aurumannotate.vim

             \             '@aurum/bufvars': '0.0',
             \             '@aurum/vimdiff': '0.0',
             \            '@aurum/annotate': '0.0',
+            \            '@aurum/cmdutils': '0.0',
             \                 '@/mappings': '0.0',
             \                       '@/os': '0.0',})
 let s:_messages={
     let bvar=s:_r.bufvars[buf]
     let hex=bvar.revisions[line('.')-1]
     let file=bvar.files[line('.')-1]
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     let hasannbuf = has_key(bvar, 'annbuf') && bufwinnr(bvar.annbuf)!=-1
     "▶2 Various *diff actions
     if a:action[-4:] is# 'diff'
                 endif
             else
                 try
-                    let file1='aurum://file:'.epath.':'.rev1.':'.file
+                    let file1='aurum://file:'.epath.':'.rev1.':'.
+                                \           s:_r.cmdutils.escape(file)
                     let existed=bufexists(file1)
                     execute 'silent edit' fnameescape(file1)
                 catch /\V\^Frawor:\[^:]\+:nofile:/
                 setlocal bufhidden=wipe
                 unlet existed
             endif
-            call s:_r.vimdiff.split('aurum://file:'.epath.':'.rev2.':'.file, -1)
+            call s:_r.vimdiff.split('aurum://file:'.epath.':'.rev2.':'.
+                        \                         s:_r.cmdutils.escape(file), -1)
             if empty(rev1)
                 wincmd p
             endif
                 let dfile=file
             endif
             let f='aurum://diff:'.epath.':'.rev1.':'.rev2.':'.
-                        \       ((a:0&&a:1)?(''):(escape(dfile,'\;:')))
+                        \       ((a:0&&a:1)?(''):(s:_r.cmdutils.escape(dfile)))
             let existed=bufexists(f)
             execute 'silent edit' fnameescape(f)
         endif
         endif
         if hasannbuf
             execute 'silent edit '.
-                        \fnameescape('aurum://annotate:'.epath.':'.hex.':'.file)
+                        \fnameescape('aurum://annotate:'.epath.':'.hex.':'.
+                        \                              s:_r.cmdutils.escape(file))
             setlocal scrollbind
             let abuf=bufnr('%')
             let newbvar=s:_r.bufvars[abuf]
             execute bufwinnr(bvar.annbuf).'wincmd w'
         endif
-        let file='aurum://file:'.epath.':'.hex.':'.file
+        let file='aurum://file:'.epath.':'.hex.':'.s:_r.cmdutils.escape(file)
         let existed=bufexists(file)
         execute 'silent edit' fnameescape(file)
         setlocal scrollbind
             return
         endif
         execute 'silent edit' fnameescape('aurum://annotate:'.epath.':'.rev.':'.
-                    \                                         bvar.file)
+                    \                           s:_r.cmdutils.escape(bvar.file))
         setlocal scrollbind
         let abuf=bufnr('%')
         let newbvar=s:_r.bufvars[abuf]
             vertical resize 42
             wincmd p
         endif
-        let file='aurum://file:'.epath.':'.rev.':'.bvar.file
+        let file='aurum://file:'.epath.':'.rev.':'.
+                    \          s:_r.cmdutils.escape(bvar.file)
         let existed=bufexists(file)
         execute 'silent edit' fnameescape(file)
         setlocal scrollbind

File ftplugin/aurumlog.vim

     else
         let spname=s:F.findCurSpecial(bvar, hex, blockstart[0])
     endif
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     let cs=bvar.repo.changesets[hex]
     let opts=s:_r.cmdutils.encodeopts(bvar.opts)
     "▶2 Commit actions based on current special
     "▶3 branch: add `branch' filter
     if spname is# 'branch'
         let cmd='edit '.fnameescape('aurum://log:'.epath.':'.opts.
-                    \               'branch:'.cs.branch.','.
-                    \               'crrestrict:branch')
+                    \               'branch:'.s:_r.cmdutils.escape(cs.branch).
+                    \               ',crrestrict:branch')
     "▶3 user: add `user' filter
     elseif spname is# 'user'
         let cmd='edit '.fnameescape('aurum://log:'.epath.':'.opts.
-                    \               'user:\V'.escape(escape(cs.user, '\:,'),
-                    \                                '\').','.
+                    \               'user:'.s:_r.cmdutils.escape(
+                    \                           '\V'.escape(cs.user, '\')).','.
                     \               'crrestrict:user')
     "▶3 time: add `date' filter (only show commits done in the current month)
     elseif spname is# 'time'
         " XXX If fileN special exists, then files property was definitely added, 
         " so no need to use getcsprop()
         let file=cs.files[str2nr(spname[4:])]
-        let cmd='edit '.fnameescape('aurum://file:'.epath.':'.hex.':'.file)
+        let cmd='edit '.fnameescape('aurum://file:'.epath.':'.hex.':'.
+                    \                             s:_r.cmdutils.escape(file))
     "▶3 curdiff: view diff between changeset and current state
     elseif spname is# 'curdiff'
         let cmd='edit '.fnameescape('aurum://diff:'.epath.'::'.hex)
         if has_key(bvar.opts, 'files') && !has_key(bvar.opts.ignorefiles,'diff')
             let cmd.=fnameescape(':'.join(map(copy(bvar.opts.csfiles[hex]),
-                        \                 'escape(v:val, "\\:;")'), ';'))
+                        \                     's:_r.cmdutils.escape(v:val)'),
+                        \                 ';'))
         endif
     "▶3 other: view commit diff
     else
         let cmd='edit '.fnameescape('aurum://diff:'.epath.':'.hex.':')
         if has_key(bvar.opts, 'files') && !has_key(bvar.opts.ignorefiles,'diff')
             let cmd.=fnameescape(':'.join(map(copy(bvar.opts.csfiles[hex]),
-                        \                 'escape(v:val, "\\:;")'), ';'))
+                        \                     's:_r.cmdutils.escape(v:val)'),
+                        \                 ';'))
         endif
     endif
     "▲3
         return ''
     endif
     let bvar=s:_r.bufvars[bufnr('%')]
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     return s:F.cwin(bvar).":silent edit ".
-                \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n"
+                \fnameescape('aurum://file:'.epath.':'.hex.':'.
+                \                          s:_r.cmdutils.escape(file))."\n"
 endfunction
 "▶1 annotate
 function s:F.annotate()
     endif
     let bvar=s:_r.bufvars[bufnr('%')]
     let cs=bvar.repo.changesets[hex]
-    let epath=escape(bvar.repo.path, ':\')
-    let efile=escape(file, '\;:')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
+    let efile=s:_r.cmdutils.escape(file)
     if a:0 && a:1
         return s:F.cwin(bvar).":silent edit ".
                     \fnameescape('aurum://diff:'.epath.':'.hex.'::'.efile)."\n"
     endif
     let bvar=s:_r.bufvars[bufnr('%')]
     let cs=bvar.repo.changesets[hex]
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     if a:0 && a:1
         return s:F.cwin(bvar).":silent edit ".
                     \fnameescape(s:_r.os.path.join(bvar.repo.path, file))."\n".
                     \':silent diffsplit '.
-                    \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n"
+                    \fnameescape('aurum://file:'.epath.':'.hex.':'.
+                    \                          s:_r.cmdutils.escape(file))."\n"
     elseif !empty(cs.parents)
         return s:F.cwin(bvar).":silent edit ".
-                    \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n".
+                    \fnameescape('aurum://file:'.epath.':'.hex.':'.
+                    \                          s:_r.cmdutils.escape(file))."\n".
                     \':silent diffsplit '.
                     \fnameescape('aurum://file:'.epath.':'.
-                    \                            cs.parents[0].':'.file)."\n"
+                    \                          cs.parents[0].':'.
+                    \                          s:_r.cmdutils.escape(file))."\n"
     endif
     return ''
 endfunction
     endif
     let bvar=s:_r.bufvars[bufnr('%')]
     let opts=s:_r.cmdutils.encodeopts(bvar.opts)
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     return ':silent edit '.
                 \fnameescape('aurum://log:'.epath.':'.opts.
-                \            'files:'.escape(s:_r.cmdutils.globescape(file),
-                \                            ';,:').','.
+                \            'files:'.s:_r.cmdutils.escape(
+                \                           s:_r.cmdutils.globescape(file)).','.
                 \            'crrestrict:files')."\n"
 endfunction
 "▶1 update

File ftplugin/aurumstatus.vim

 setlocal nomodeline
 execute frawor#Setup('0.0', {'@aurum/bufvars': '0.0',
             \                '@aurum/vimdiff': '0.0',
+            \               '@aurum/cmdutils': '0.0',
             \                 '@aurum/commit': '0.0',
             \                    '@/mappings': '0.0',
             \                          '@/os': '0.0',})
     let vline1=line("'<")
     let vline2=line("'>")
     let file=bvar.files[curline]
-    let epath=escape(bvar.repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(bvar.repo.path)
     if has_key(s:noacttypes, a:action) &&
                 \index(s:noacttypes[a:action], bvar.types[curline])!=-1
         return ''
     if a:action is# 'open'
         execute 'silent e' fnameescape(s:_r.os.path.join(bvar.repo.path,file))
     elseif a:action is# 'revopen'
-        execute 'silent e' fnameescape('aurum://file:'.epath.':'.rev1.':'.file)
+        execute 'silent e' fnameescape('aurum://file:'.epath.':'.rev1.':'.
+                    \                                s:_r.cmdutils.escape(file))
     elseif a:action is# 'fulldiff'
         execute 'silent e' fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2)
     elseif a:action is# 'revfulldiff'
         execute 'silent edit' fnameescape('aurum://diff:'.epath.':'.rev1)
     elseif a:action is# 'revvimdiff' || a:action is# 'vimdiff'
-        let file1=fnameescape('aurum://file:'.epath.':'.rev1.':'.file)
+        let file1='aurum://file:'.epath.':'.rev1.':'.s:_r.cmdutils.escape(file)
         if empty(rev2) || a:action is# 'vimdiff'
-            let file2=fnameescape(s:_r.os.path.join(bvar.repo.path, file))
+            let file2=s:_r.os.path.join(bvar.repo.path, file)
         else
-            let file2=fnameescape('aurum://file:'.epath.':'.rev2.':'.file)
+            let file2='aurum://file:'.epath.':'.rev2.':'.
+                        \           s:_r.cmdutils.escape(file)
         endif
         if get(bvar.opts, 'record', 0)
-            execute 'silent view' file2
+            execute 'silent view' fnameescape(file2)
             diffthis
             execute rwnr.'wincmd w'
-            execute 'silent view' file1
+            execute 'silent view' fnameescape(file1)
             diffthis
             wincmd p
         else
-            execute 'silent edit' file2
+            execute 'silent edit' fnameescape(file2)
             call s:_r.vimdiff.split(file1, -1)
         endif
     elseif a:action is# 'annotate'
-        execute 'silent edit' fnameescape('aurum://file:'.epath.':'.rev1.
-                    \                                           ':'.file)
+        execute 'silent edit' fnameescape('aurum://file:'.epath.':'.rev1.':'.
+                    \                                s:_r.cmdutils.escape(file))
         AuAnnotate
     endif
     if visual
     elseif a:action is# 'diff'
         execute 'silent edit'
                     \fnameescape('aurum://diff:'.epath.':'.rev1.'::'.
-                    \            join(map(copy(files), 'escape(v:val, "\\;:")'),
-                    \                 ';'))
+                    \            join(map(copy(files),
+                    \                     's:_r.cmdutils.escape(v:val)'), ';'))
     elseif a:action is# 'revdiff'
         execute 'silent edit'
                     \fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.':'.
-                    \            join(map(copy(files), 'escape(v:val, "\\;:")'),
-                    \                 ';'))
+                    \            join(map(copy(files),
+                    \                     's:_r.cmdutils.escape(v:val)'), ';'))
     endif
 endfunction
 let s:_augroups+=['AuStatusCommit']

File 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'
+changeset = ':\n{rev}\n{node}\n{branch|json}\n{date}\n{author|json}\n{parents}{tags}{bookmarks}{files}{file_dels}{file_copies}\t{desc|json}\n'
+parent    = 'P{node|json}\n'
+tag       = 'T{tag|json}\n'
+bookmark  = 'B{bookmark|json}\n'
+file      = 'C{file|json}\n'
+file_del  = 'R{file_del|json}\n'
+file_copy = 'D{name|json}\n{source|json}\n'

File plugin/aurum.vim

             \ 'unkurl': 'Failed to process url %s of repository %s',
             \'nofiles': 'No files were specified',
             \   'nogf': 'No files found',
+            \  'nrepo': 'Not a repository: %s',
             \'_mvheader': ['Source', 'Destination'],
         \}
 let s:_options={
 "▶2 repotuplesplit :: str, UInt → (repo, String, ...)
 function s:F.repotuplesplit(str, num)
     let tail=a:str
-    let repopath=matchstr(tail, '\v^(\\.|[^\\:]+)')
+    let repopath=matchstr(tail, '\v^[^:]+')
     let tail=tail[len(repopath)+1:]
-    let repo=s:_r.repo.get(substitute(repopath,'\v\\([\\:])','\1','g'))
+    let repo=s:_r.repo.get(s:_r.cmdutils.unescape(repopath))
+    if repo is 0
+        call s:_f.throw('nrepo', repopath)
+    endif
     let r=[repo]
     let i=0
     while i<a:num-1
-        let chunk=matchstr(tail, '\v^(\\.|[^\\:])+')
+        let chunk=matchstr(tail, '\v^[^:]+')
         let tail=tail[len(chunk)+1:]
-        call add(r, chunk)
+        call add(r, s:_r.cmdutils.unescape(chunk))
         let i+=1
     endwhile
-    call add(r, tail)
+    call add(r, s:_r.cmdutils.unescape(tail))
     return r
 endfunction
 "▶2 repotupleoptssplit :: str, UInt → (repo, ..., opts::Dictionary)
     let [repo; strings]=s:F.repotuplesplit(a:str, a:num+1)
     let ostr=remove(strings, -1)
     let opts={}
-    for o in split(ostr, '\v%(\\@<!\\%(\\\\)*)@<!,')
+    for o in split(ostr, ',')
         let colonidx=stridx(o, ':')
         if colonidx==-1
             continue
         endif
-        let opts[o[:(colonidx-1)]]=substitute(o[(colonidx+1):],
-                    \                         '\v\\([:,\\])', '\1', 'g')
+        let opts[o[:(colonidx-1)]]=s:_r.cmdutils.unescape(o[(colonidx+1):])
     endfor
     return [repo]+strings+[opts]
 endfunction
 "▲2
 function s:auefunc.function(read) abort
-    "▶2 Split <amatch> into command and arguments
-    let tail=substitute(expand('<amatch>'), '\V\^aurum://', '', '')
+    "▶2 Split buffer name into command and arguments
+    " XXX Cannot use <amatch> because it unescapes arguments on windows
+    " XXX On windows all forward slashes are transformed to backward
+    let tail=expand('<amatch>')[len('aurum://'):]
     let command=tolower(matchstr(tail, '\v^\w+'))
     let tail=tail[len(command)+1:]
     "▲2
     if command is# 'log'
         let [repo, opts]=s:F.repotupleoptssplit(tail, 0)
         if has_key(opts, 'files')
-            let opts.files=split(opts.files, '\v%(\\@<!\\%(\\\\)*)@<!;')
+            let opts.files=map(split(opts.files, ';'),
+                        \      's:_r.cmdutils.unescape(v:val)')
             let opts.filepats=map(copy(opts.files),
                         \         's:_r.cmdutils.globtopat(v:val)')
         endif
             let rev2=repo.functions.getrevhex(repo, rev2)
         endif
         "▲3
-        let filelist=map(split(files, '\v%(\\@<!\\%(\\\\)*)@<!;'),
-                    \    'substitute(v:val, ''\v\\([\\;:])'', "\\1", "g")')
+        let filelist=map(split(files, ';'), 's:_r.cmdutils.unescape(v:val)')
         " XXX All options should be from s:_r.repo.diffoptslst list
         call map(opts, '+v:val')
         if a:read
     elseif command is# 'status'
         let [repo, opts]=s:F.repotupleoptssplit(tail, 0)
         if has_key(opts, 'files')
-            let opts.files=split(opts.files, '\v%(\\@<!\\%(\\\\)*)@<!;')
+            let opts.files=map(split(opts.files, ';'),
+                        \      's:_r.cmdutils.unescape(v:val)')
             let opts.filepats=map(copy(opts.files),
                         \         's:_r.cmdutils.globtopat(v:val)')
         endif
         endif
         let [repo, user, date, cb, files]=s:F.repotuplesplit(tail, 4)
         let bvar={'repo': repo, 'user': user, 'date': date, 'closebranch': !!cb,}
-        let bvar.files=map(split(files, '\v%(\\@<!\\%(\\\\)*)@<!;'),
-                    \      'substitute(v:val, ''\v\\([\;])'', "\\1", "g")')
+        let bvar.files=map(split(files, ';'), 's:_r.cmdutils.unescape(v:val)')
         let s:_r.bufvars[buf]=bvar
         setlocal modifiable noreadonly
         augroup AuCommitMessage
     else
         let repo=s:_r.repo.get(':')
     endif
+    call s:_r.cmdutils.checkrepo(repo)
     let allfiles=s:F.getexsttrckdfiles(repo)
     if get(a:opts, 'copy', 0)
         let key='copy'
         call s:_f.throw('nofiles')
     endif
     let repo=s:_r.repo.get(a:1)
+    call s:_r.cmdutils.checkrepo(repo)
     let allfiles=s:F.getexsttrckdfiles(repo)
     let globs=filter(copy(a:000), 'v:val isnot# ":"')
     let hascur=(len(globs)!=a:0)
     let globs=filter(copy(a:000), 'v:val isnot# ":"')
     let hascur=!(a:0 && len(globs)==a:0)
     let repo=s:_r.repo.get(a:0 ? a:1 : ':')
+    call s:_r.cmdutils.checkrepo(repo)
     let allfiles=s:F.getaddedermvdfiles(repo)
     let files=s:F.filterfiles(repo, globs, allfiles)
     if hascur
     endif
     let wdfiles=((has_key(a:opts, 'wdfiles'))?(a:opts.wdfiles):
                 \                             (s:_f.getoption('workdirfiles')))
+    let epath=s:_r.cmdutils.escape(repo.path)
     let qf=repo.functions.grep(repo, a:pattern, files, revisions,
                 \              get(a:opts, 'ignorecase', 0), wdfiles)
+    for item in filter(copy(qf), 'type(v:val.filename)=='.type([]))
+        let item.filename='aurum://file:'.epath.':'.item.filename[0].':'.
+                    \                   s:_r.cmdutils.escape(item.filename[1])
+    endfor
     call setqflist(qf)
 endfunction
 let s:grepfunc['@FWC']=['-onlystrings '.

File plugin/aurum/annotate.vim

     if rev is 0
         let rev=repo.work_hex
     endif
-    let epath=escape(repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(repo.path)
     if hasannbuf
         let annbuf=bufnr('%')
     else
         " TODO Check for errors
-        let afile='aurum://file:'.epath.':'.rev.':'.file
+        let afile='aurum://file:'.epath.':'.rev.':'.
+                    \           s:_r.cmdutils.escape(file)
         let existed=bufexists(afile)
         execute 'silent edit' fnameescape(afile)
         let annbuf=bufnr('%')
     endif
     setlocal scrollbind
     execute 'silent leftabove 42vsplit '.
-                \fnameescape('aurum://annotate:'.epath.':'.rev.':'.file)
+                \fnameescape('aurum://annotate:'.epath.':'.rev.':'.
+                \                              s:_r.cmdutils.escape(file))
     setlocal scrollbind
     setlocal bufhidden=wipe
     let buf=bufnr('%')

File plugin/aurum/cmdutils.vim

     let r.='\v($|\/)'
     return r
 endfunction
+"▶1 oescape :: String → String
+let s:ecodes={
+            \'%': '%',
+            \',': 'c', ':': '.', ';': 's',
+            \'/': '-', '\': '+',
+            \'[': 'b', ']': 'B',
+            \'{': 'f', '}': 'F',
+            \'*': 'a', '?': 'q',
+            \'`': "'", '$': 'd',
+        \}
+let s:epattern='\v['.escape(join(keys(s:ecodes), ''), '\]-^').']'
+function s:F.oescape(str)
+    " TODO fallback in case of being inside \=
+    return substitute(a:str, s:epattern, '\="%".s:ecodes[submatch(0)]', 'g')
+endfunction
+"▶1 ounescape :: String → String
+let s:unecodes={}
+call map(copy(s:ecodes), 'extend(s:unecodes, {v:val : v:key}, "error")')
+let s:unepattern='\V%\(\['.escape(join(keys(s:unecodes), ''), '\]-^').']\)'
+function s:F.ounescape(str)
+    let str=tr(a:str, '\', '/')
+    return substitute(str, s:unepattern, '\=s:unecodes[submatch(1)]', 'g')
+endfunction
 "▶1 encodeopts :: opts → String
 let s:ignkeys=['crrestrict', 'filepats', 'revs', 'cmd', 'repo']
 function s:F.encodeopts(opts)
                 \                             'index(s:ignkeys, v:val[0])==-1')
         let r.=key.':'
         if type(value)==type([])
-            let r.=join(map(copy(value), 'escape(v:val, "\\:,;")'), ';')
+            let r.=join(map(copy(value), 's:F.oescape(v:val)'), ';')
         else
-            let r.=escape(value, '\:,')
+            let r.=s:F.oescape(value)
         endif
         let r.=','
         unlet value
                                     \bufwinnr(bvar.annbuf)!=-1
                             execute bufwinnr(bvar.annbuf).'wincmd w'
                         else
-                            let epath=escape(repo.path, ':\')
+                            let epath=s:F.oescape(repo.path)
                             setlocal scrollbind
                             execute 'silent rightbelow vsplit'
                                         \fnameescape('aurum://file:'.epath.':'.
                                         \                            rev.  ':'.
-                                        \                            file)
+                                        \                     s:F.oescape(file))
                             let bvar.annbuf=bufnr('%')
                             setlocal scrollbind
                         endif
             \                        'setlines': s:F.setlines,
             \                        'closebuf': s:F.closebuf,
             \                         'prevbuf': s:F.prevbuf,
+            \                          'escape': s:F.oescape,
+            \                        'unescape': s:F.ounescape,
             \                    'nogetrepoarg': s:nogetrepoarg,
             \})
 "▶1 Some completion-related globals

File plugin/aurum/commit.vim

     endif
     "▲2
     if empty(message)
-        let epath=escape(a:repo.path, ':\')
-        let euser=escape(user, ':\')
+        let epath=s:_r.cmdutils.escape(a:repo.path)
+        let euser=s:_r.cmdutils.escape(user)
         execute 'silent new '.
                     \fnameescape('aurum://commit:'.epath.':'.euser.':'.date.':'.
                     \                                        cb.':'.
 let s:commfunc['@FWC']=['-onlystrings '.
             \           '{  repo '.s:_r.cmdutils.nogetrepoarg.
             \           ' *?type      (either (in [modified added removed '.
-            \                                     'deleted uknown] ~start, '.
+            \                                     'deleted unknown] ~start, '.
             \                                 'match /\v^[MARDU?!]+$/))'.
             \           '  ?message   (type "")'.
             \           '  ?user      (type "")'.

File plugin/aurum/diff.vim

     "▲2
     let opts=s:_r.cmdutils.encodeopts(filter(copy(a:opts),
                 \                    'index(s:_r.repo.diffoptslst, v:key)!=-1'))
-    let epath=escape(repo.path, ':\')
-    let efiles=join(map(filelist, 'escape(v:val, "\\;:")'), ';')
+    let epath=s:_r.cmdutils.escape(repo.path)
+    let efiles=join(map(filelist, 's:_r.cmdutils.escape(v:val)'), ';')
     let prevbuf=s:_r.cmdutils.prevbuf()
     execute get(a:opts, 'cmd', 'silent edit')
                 \ fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.
         else
             let rev2=bvar.repo.functions.getnthparent(bvar.repo,bvar.rev2,c).hex
         endif
-        let epath=escape(bvar.repo.path, ':\')
+        let epath=s:_r.cmdutils.escape(bvar.repo.path)
         let cmd.=':edit '.
                     \fnameescape('aurum://diff:'.epath.':'.rev1.':'.rev2.':'.
-                    \                            bvar.originfiles.':'.
-                    \                  s:_r.cmdutils.encodeopts(bvar.opts))."\n"
+                    \                s:_r.cmdutils.escape(bvar.originfiles).':'.
+                    \                s:_r.cmdutils.encodeopts(bvar.opts))."\n"
         let cmd.=s:mmgroup
         let cmd.=":bwipeout ".buf."\n"
     elseif a:action is# 'open'
         if file is 0
             return ''
         endif
-        let epath=escape(bvar.repo.path, ':\')
+        let epath=s:_r.cmdutils.escape(bvar.repo.path)
         let fullpath=s:_r.os.path.join(bvar.repo.path, file)
         if empty(bvar.rev1)
             if filereadable(fullpath)

File plugin/aurum/drivers/mercurial.vim

     endif
     return r
 endfunction
+"▶2 unesc :: String → String
+let s:F.unesc=function('eval')
 "▶2 parsecs :: csdata, lstart::UInt → [cs, line::UInt]
+" TODO Check style file on windows (may be issues regarding used path separator:
+"      it is expected to be a forward slash)
 let s:stylefile=shellescape(s:_r.os.path.join(s:_frawor.runtimepath,
                 \                             'misc', 'map-cmdline.csinfo'))
 let s:chars=[['P', 'parents'],
     endif
     let line+=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
+    let cs.rev    = str2nr(a:csdata[line])    | let line+=1
+    let cs.hex    = a:csdata[line]            | let line+=1
+    let cs.branch = s:F.unesc(a:csdata[line]) | let line+=1
+    let cs.time   = str2nr(a:csdata[line])    | let line+=1
+    let cs.user   = s:F.unesc(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 cs[key]+=[s:F.unesc(a:csdata[line][1:])]
             let line+=1
         endwhile
     endfor
     "▶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 copies[s:F.unesc(a:csdata[line][1:])]=s:F.unesc(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 description+=[a:csdata[line][1:]]
-        let line+=1
-    endwhile
-    let cs.description=join(description, "\n")
+    let cs.description=s:F.unesc(a:csdata[line][1:])
+    let line+=1
     "▲3
     return [cs, line]
 endfunction
                 \'local': (stridx(a:path, '://')==-1),
                 \'functions': copy(s:hg),}
     try
-        let repo.work_hex=s:hg.getrevhex(repo, '.')
+        let lines=s:F.hg(repo, 'log --template '.shellescape('{rev}:{node}\n').
+                    \             ' -r . -r tip', 0, 'log')[:-2]
     catch
         return 0
     endtry
-    let tipcs=s:hg.getcs(repo, 'tip')
-    let repo.tip_hex=tipcs.hex
-    let repo.csnum=tipcs.rev+2
+    let t=(len(lines)!=1)
+    let repo.work_hex = lines[0][ stridx(lines[0], ':')+1:]
+    let repo.tip_hex  = lines[t][ stridx(lines[t], ':')+1:]
+    let repo.csnum    = lines[t][:stridx(lines[t], ':')-1 ]+2
     return repo
 endfunction
 endif
         call s:_f.throw('statfail', a:repo.path, join(slines, "\n"))
     endif
     let r=deepcopy(s:initstatdct)
-    call map(copy(slines), 'add(r[s:hgstatchars[v:val[0]]], v:val[2:])')
+    call map(copy(slines), 'add(r[s:hgstatchars[v:val[0]]], '.
+                \              'join(s:_r.os.path.split(v:val[2:])[1:], "/"))')
     if a:0>2 && !empty(a:3)
         call map(r, 'map(v:val, "a:repo.functions.reltorepo(a:repo, v:val)")')
     endif
 endfunction
 else "▶2
 function s:hg.commit(repo, message, ...)
-    let kwargs={'message': a:message}
+    let kwargs={}
+    let usingfile=0
+    if a:message=~#'\v[\r\n]'
+        let tmpfile=tempname()
+        call writefile(split(a:message, "\n", 1), tmpfile, 'b')
+        let kwargs.logfile=tmpfile
+        let usingfile=1
+    else
+        let kwargs.message=a:message
+    endif
     let args=[]
     if a:0
         if !empty(a:1)
             let kwargs.close_branch=1
         endif
     endif
-    call s:F.runcmd(a:repo, 'commit', args, kwargs, 1)
+    try
+        call s:F.runcmd(a:repo, 'commit', args, kwargs, 0)
+    finally
+        if usingfile && filereadable(tmpfile)
+            call delete(tmpfile)
+        endif
+    endtry
 endfunction
 endif
 "▶1 hg.update :: repo, rev, force
             call s:_f.throw('grepfail', a:repo.path, join(lines, "\n"))
         endif
     endif
-    let epath=escape(a:repo.path, ':\')
     let r=[]
     let cnmscache={}
     for line in lines
         endif
         let [file, rev, lnum, text]=match[1:4]
         if a:wdfiles && s:F.checknotmodifiedsince(a:repo, rev, file, cnmscache)
-            let file=s:_r.os.path.normpath(s:_r.os.path.join(a:repo.path, file))
+            let filename=s:_r.os.path.normpath(s:_r.os.path.join(a:repo.path, file))
         else
-            let file='aurum://file:'.epath.':'.rev.':'.file
+            let filename=[rev, file]
         endif
-        let r+=[{'filename': file, 'lnum': lnum, 'text': text}]
+        let r+=[{'filename': filename, 'lnum': lnum, 'text': text}]
+        unlet filename
     endfor
     return r
 endfunction

File plugin/aurum/file.vim

         call s:_r.cmdutils.setlines(repo.functions.readfile(repo, rev, file), 0)
         return
     endif
-    let epath=escape(repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(repo.path)
     if hasbuf
         let filetype=&filetype
     endif
     let prevbuf=s:_r.cmdutils.prevbuf()
     execute get(a:opts, 'cmd', 'silent edit')
-                \ fnameescape('aurum://file:'.epath.':'.rev.':'.file)
+                \ fnameescape('aurum://file:'.epath.':'.rev.':'.
+                \                           s:_r.cmdutils.escape(file))
     if exists('filetype') && &filetype isnot# filetype
         let &filetype=filetype
     endif
     elseif a:action is# 'previous' || a:action is# 'next'
         let c=((a:action is# 'previous')?(v:count1):(-v:count1))
         let rev=bvar.repo.functions.getnthparent(bvar.repo, bvar.rev, c).hex
-        let epath=escape(bvar.repo.path, ':\')
-        let cmd.=':edit '.fnameescape('aurum://file:'.epath.':'.rev.
-                    \                             ':'.bvar.file)."\n"
+        let epath=s:_r.cmdutils.escape(bvar.repo.path)
+        let cmd.=':edit '.fnameescape('aurum://file:'.epath.':'.rev.':'.
+                    \                      s:_r.cmdutils.escape(bvar.file))."\n"
         let cmd.=s:mmgroup
         let cmd.=":bwipeout ".buf."\n"
     elseif a:action is# 'vimdiff' || a:action is# 'revvimdiff'
             let cmd.=':diffsplit '.fnameescape(file)."\n"
         else
             let rev=bvar.repo.functions.getnthparent(bvar.repo, bvar.rev, 1).hex
-            let epath=escape(bvar.repo.path, ':\')
-            let file='aurum://file:'.epath.':'.rev.':'.bvar.file
+            let epath=s:_r.cmdutils.escape(bvar.repo.path)
+            let file='aurum://file:'.epath.':'.rev.':'.
+                        \          s:_r.cmdutils.escape(bvar.file)
             let cmd.=':call call(<SNR>'.s:_sid.'_Eval("s:_r.vimdiff.split"), '.
                         \       '['.string(file).", 0], {})\n:wincmd p\n"
         endif

File plugin/aurum/log.vim

         let cmd='silent new'
     endif
     let optsstr=s:_r.cmdutils.encodeopts(opts)
-    let epath=escape(repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(repo.path)
     execute cmd fnameescape('aurum://log:'.epath.':'.optsstr)
     if !has_key(opts, 'cmd')
         setlocal bufhidden=wipe

File plugin/aurum/record.vim

     else
         let repo=s:_r.repo.get(a:opts.repo)
     endif
-    let epath=escape(repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(repo.path)
     call map(files, 'repo.functions.reltorepo(repo, v:val)')
     tabnew
     setlocal bufhidden=wipe
     let w:aurecid='AuRecordRight'
     let opts='record:1'
     if !empty(files)
-        let opts.=',files:'.join(map(copy(files), 'escape(v:val,"\\;:,")'), ';')
+        let opts.=',files:'.join(map(copy(files),
+                    \                's:_r.cmdutils.escape(v:val)'), ';')
     endif
     let height=s:_f.getoption('recheight')
     if height<=0
         let [lwnr, rwnr, swnr]=s:F.getwnrs()
         let file=bvar.lines[line('.')-1][2:]
         let type=bvar.types[line('.')-1]
-        let epath=escape(bvar.repo.path, ':\')
+        let epath=s:_r.cmdutils.escape(bvar.repo.path)
         let status=bvar.statuses[line('.')-1]
         let modified=status%2
         execute lwnr.'wincmd w'
                 if ntype is# 'r'
                     diffthis
                     execute rwnr.'wincmd w'
-                    let epath=escape(bvar.repo.path, ':\')
+                    let epath=s:_r.cmdutils.escape(bvar.repo.path)
                     call s:F.edit(bvar,
                                 \'aurum://file:'.epath.':'.bvar.repo.work_hex.
-                                \            ':'.file, 1)
+                                \            ':'.s:_r.cmdutils.escape(file), 1)
                     diffthis
                     wincmd p
                 endif
         endif
     "▶2 commit
     elseif a:action is# 'commit'
-        let epath=escape(bvar.repo.path, ':\')
+        let epath=s:_r.cmdutils.escape(bvar.repo.path)
         let files=filter(copy(bvar.files), 'bvar.statuses[v:key]>1')
         if empty(files)
             call s:_f.warn('recnof')

File plugin/aurum/status.vim

     for [key, value] in items(a:opts)
         let opt=key.':'
         if key is# 'files'
-            let opt.=join(map(copy(value), 'escape(v:val, "\\:;,")'), ';')
+            let opt.=join(map(copy(value), 's:_r.cmdutils.escape(v:val)'), ';')
         elseif key is# 'show'
             let opt.=join(value, ';')
         else
-            let opt.=escape(value, '\:,')
+            let opt.=s:_r.cmdutils.escape(value)
         endif
         call add(opts, opt)
         unlet value
     endfor
-    let statf='aurum://status:'.escape(repo.path, ':\').':'.join(opts, ',')
+    let epath=s:_r.cmdutils.escape(repo.path)
+    let statf='aurum://status:'.epath.':'.join(opts, ',')
     let cmd='silent botright new'
     if has_key(a:opts, 'cmd')
         let cmd=a:opts.cmd

File plugin/aurum/vimdiff.vim

         endif
     endif
     "▶2 Open first buffer
-    let epath=escape(repo.path, ':\')
+    let epath=s:_r.cmdutils.escape(repo.path)
     let frev=remove(revs, 0)
     if hasbuf
         let fbuf=bufnr('%')
             execute 'silent edit' fnameescape(s:_r.os.path.join(repo.path,file))
         else
             execute 'silent edit '.
-                        \fnameescape('aurum://file:'.epath.':'.frev.':'.file)
+                        \fnameescape('aurum://file:'.epath.':'.frev.':'.
+                        \                         s:_r.cmdutils.escape(file))
         endif
         let t:auvimdiff_prevbuffers[bufnr('%')]=prevbuf
         let fbuf=bufnr('%')
         if rev is 0
             let f=file
         else
-            let f='aurum://file:'.epath.':'.rev.':'.file
+            let f='aurum://file:'.epath.':'.rev.':'.s:_r.cmdutils.escape(file)
         endif
         if !i && hasbuf && len(revs)==1
             let existed=bufexists(f)

File python/aurum.py

                                                     exact=True))[6]
             status_cache[key]=r
             return r
-        epath=repo.root.replace('\\', '\\\\').replace(':', '\\:')
         for line in lines:
             m=grepre.match(line)
             if not m:
             if wdfiles and check_not_modified_since(rev, file):
                 file=os.path.join(repo.root, file)
             else:
-                file='aurum://file:'+epath+':'+rev+':'+file
+                file=(rev, file)
             r_vim.append({'filename': file, 'lnum': int(lnum), 'text': text})
         vim.eval('extend(r, '+nonutf_dumps(r_vim)+')')
     except AurumError:

File test/annotate-buffers.ok

 {{{1 file
 annotate-buffersrepo/chgrepo.zsh
-aurum://annotate:%TMPDIR%/test/annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
+aurum://annotate:%ETMPDIR%%-test%-annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
 annotate-buffersrepo/chgrepo.zsh
 w$: 2, w0: 2, w#: 1
 {{{1 aurum://file
 aurum://file:testrepo:10:chgrepo.zsh
-aurum://annotate:%TMPDIR%/test/testrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
+aurum://annotate:%ETMPDIR%%-test%-testrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
 aurum://file:testrepo:10:chgrepo.zsh
 w$: 2, w0: 2, w#: 1
 {{{1 aurum://copy
 aurum://copy:testrepo/chgrepo.zsh
-aurum://annotate:%TMPDIR%/test/testrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
+aurum://annotate:%ETMPDIR%%-test%-testrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
 aurum://copy:testrepo/chgrepo.zsh
 w$: 2, w0: 2, w#: 1
 {{{1 aurum://status
-aurum://file:%TMPDIR%/test/annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
-aurum://annotate:%TMPDIR%/test/annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
-aurum://status:%TMPDIR%/test/annotate-buffersrepo:show:clean
+aurum://file:%ETMPDIR%%-test%-annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
+aurum://annotate:%ETMPDIR%%-test%-annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
+aurum://status:%ETMPDIR%%-test%-annotate-buffersrepo:show:clean
 w$: 4, w0: 2, w#: 1
 {{{1 aurum://diff
-aurum://file:%TMPDIR%/test/testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-aurum://annotate:%TMPDIR%/test/testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://annotate:%ETMPDIR%%-test%-testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 aurum://diff:testrepo::2:crepo.zsh
 w$: 3, w0: 2, w#: 1
 {{{1 aurum://commit
-aurum://file:%TMPDIR%/test/annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
-aurum://annotate:%TMPDIR%/test/annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+aurum://file:%ETMPDIR%%-test%-annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+aurum://annotate:%ETMPDIR%%-test%-annotate-buffersrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 aurum://commit:annotate-buffersrepo::::nohglinesrev.lst
 w$: 3, w0: 2, w#: 1
 {{{1 aurum://annotate 1
-aurum://file:%TMPDIR%/test/testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
-aurum://annotate:%TMPDIR%/test/testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
-aurum://file:%TMPDIR%/test/testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
+aurum://annotate:%ETMPDIR%%-test%-testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:99ea42d70fbe32af955de907352999b1d94bef5f:createrepo.zsh
 w$: 2, w0: 2, w#: 1
 {{{1 aurum://annotate 2
-aurum://file:%TMPDIR%/test/testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 aurum://annotate:testrepo:2:crepo.zsh
-aurum://file:%TMPDIR%/test/testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 w$: 2, w0: 2, w#: 1

File test/annotate.ok

Binary file modified.

File test/annotatemaps.ok

 {{{1 o
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 {{{1 a
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 {{{1 <CR>
-#1: aurum://file:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 *2: %TMPDIR%/test/annotatemapsrepo/chgrepo.zsh
 {{{1 D
-#1: aurum://file:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 *2: %TMPDIR%/test/annotatemapsrepo/chgrepo.zsh
 {{{1 C
-*1: aurum://file:%TMPDIR%/test/testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-#2: aurum://file:%TMPDIR%/test/testrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+*1: aurum://file:%ETMPDIR%%-test%-testrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#2: aurum://file:%ETMPDIR%%-test%-testrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
 {{{1 d
-*1: aurum://diff:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2::crepo.zsh
+*1: aurum://diff:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2::crepo.zsh
 {{{1 c
-*1: aurum://diff:%TMPDIR%/test/annotatemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:5a6a1bf999fad1f4547eeb887af54f31d11833f2:chgrepo.zsh
+*1: aurum://diff:%ETMPDIR%%-test%-annotatemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:5a6a1bf999fad1f4547eeb887af54f31d11833f2:chgrepo.zsh
 {{{1 gd
-*1: aurum://diff:%TMPDIR%/test/annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2::
+*1: aurum://diff:%ETMPDIR%%-test%-annotatemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2::
 {{{1 gc
-*1: aurum://diff:%TMPDIR%/test/annotatemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:5a6a1bf999fad1f4547eeb887af54f31d11833f2:
+*1: aurum://diff:%ETMPDIR%%-test%-annotatemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:5a6a1bf999fad1f4547eeb887af54f31d11833f2:
 {{{1 K/J
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:c4110a066208167dae46b08f4e0d8d2b37e842f3:chgrepo.zsh
 {{{1 2K/2J
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
-#1: aurum://annotate:%TMPDIR%/test/annotatemapsrepo:250ba7cd831ee91c3ba5bef1faebc38c5dbca5f8:chgrepo.zsh
-*2: aurum://file:%TMPDIR%/test/annotatemapsrepo:250ba7cd831ee91c3ba5bef1faebc38c5dbca5f8:chgrepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:0e6e0adf281b423193f9dce097ab1df4f91215f7:chgrepo.zsh
+#1: aurum://annotate:%ETMPDIR%%-test%-annotatemapsrepo:250ba7cd831ee91c3ba5bef1faebc38c5dbca5f8:chgrepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-annotatemapsrepo:250ba7cd831ee91c3ba5bef1faebc38c5dbca5f8:chgrepo.zsh
 {{{1 U
 100
 010

File test/audiffmaps.ok

 0
-aurum://diff:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
-aurum://diff:%TMPDIR%/test/audiffmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:99ea42d70fbe32af955de907352999b1d94bef5f::
-aurum://diff:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:99ea42d70fbe32af955de907352999b1d94bef5f::
+aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
 1
-aurum://diff:%TMPDIR%/test/audiffmapsrepo:7e16e7cbaf9ec5b0e65832bc6f057ba825c38cac:a16a47a8d7aafc115651bfee6f1202093765365d:datelines.lst;hglines.lst:
-=aurum://diff:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
-*1: aurum://diff:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
-#2: aurum://diff:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
-aurum://file:%TMPDIR%/test/audiffmapsrepo:7e16e7cbaf9ec5b0e65832bc6f057ba825c38cac:hglines.lst
+aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:7e16e7cbaf9ec5b0e65832bc6f057ba825c38cac:a16a47a8d7aafc115651bfee6f1202093765365d:datelines.lst;hglines.lst:
+=aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+*1: aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+#2: aurum://diff:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+aurum://file:%ETMPDIR%%-test%-audiffmapsrepo:7e16e7cbaf9ec5b0e65832bc6f057ba825c38cac:hglines.lst
 %TMPDIR%/test/audiffmapsrepo/crepo.zsh
 2
 %TMPDIR%/test/audiffmapsrepo/crepo.zsh
-aurum://file:%TMPDIR%/test/audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-audiffmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh

File test/aufilemaps.ok

 0
-aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-aurum://file:%TMPDIR%/test/aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
-aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 1
-aurum://file:%TMPDIR%/test/aufilemapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
-=aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-*1: aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-#2: aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
-aurum://diff:%TMPDIR%/test/aufilemapsrepo::5a6a1bf999fad1f4547eeb887af54f31d11833f2::
-aurum://diff:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
+=aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+*1: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#2: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum://diff:%ETMPDIR%%-test%-aufilemapsrepo::5a6a1bf999fad1f4547eeb887af54f31d11833f2::
+aurum://diff:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
 ::: D
 *1: %TMPDIR%/test/aufilemapsrepo/crepo.zsh
-#2: aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#2: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 ::: C
-#1: aurum://file:%TMPDIR%/test/aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
-*2: aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
 ::: ,X
-*1: aurum://file:%TMPDIR%/test/aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+*1: aurum://file:%ETMPDIR%%-test%-aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh

File test/commit.in

 Multiline
 commit
 comment:silent write
+:
+:" There is a problem with running next command in wine without the above line.
 :WT
 :W{{{1 ,i mapping
 :call append('$', 'Brand new text')

File test/copyout-postproc.zsh

 function normpaths()
 {
     [[ ${PREFIX[-4,-1]} == wine ]] && local -x TMPDIR='T:'
-    perl -p -i -e 's/\Q$ENV{"TMPDIR"}\E/%TMPDIR%/g' $1
+    local -x ETMPDIR=${${TMPDIR//\//%-}//:/%.}
+    perl -p -i -e 's/\Q$ENV{"TMPDIR"}\E/%TMPDIR%/g;
+                   s/\Q$ENV{"ETMPDIR"}\E/%ETMPDIR%/g;' $1
 }
 function normdates()
 {

File test/file.ok

-aurum://file:%TMPDIR%/test/filerepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
-aurum://file:%TMPDIR%/test/filerepo:a16a47a8d7aafc115651bfee6f1202093765365d:chgrepo.zsh
-aurum://file:%TMPDIR%/test/testrepo:d760b0fe4fe45adf585f5030181b8081899e26a9:dlines.lst
-aurum://file:%TMPDIR%/test/testrepo:d760b0fe4fe45adf585f5030181b8081899e26a9:dlines.lst
+aurum://file:%ETMPDIR%%-test%-filerepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
+aurum://file:%ETMPDIR%%-test%-filerepo:a16a47a8d7aafc115651bfee6f1202093765365d:chgrepo.zsh
+aurum://file:%ETMPDIR%%-test%-testrepo:d760b0fe4fe45adf585f5030181b8081899e26a9:dlines.lst
+aurum://file:%ETMPDIR%%-test%-testrepo:d760b0fe4fe45adf585f5030181b8081899e26a9:dlines.lst
 w$: 1
-aurum://file:%TMPDIR%/test/testrepo:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe:dlines.lst
+aurum://file:%ETMPDIR%%-test%-testrepo:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe:dlines.lst
 w$: 2; l$: 52
-aurum://file:%TMPDIR%/test/testrepo:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe:dlines.lst
+aurum://file:%ETMPDIR%%-test%-testrepo:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe:dlines.lst
 l$: 94

File test/gentests-expand-tmpdir.zsh

 () {
     emulate -L zsh
     [[ ${TESTTYPE[-4,-1]} == wine ]] && local -x TMPDIR='T:'
-    perl -p -i -e 's/%TMPDIR%/$ENV{"TMPDIR"}/g' *.ok
+    local -x ETMPDIR=${${TMPDIR//\//%-}//:/%.}
+    perl -p -i -e 's/%(E?TMPDIR)%/$ENV{$1}/g' *.ok
 }

File test/grep.ok

 glinescopy.lst|72| hg commit -A -m 'Added nohglinesrev.lst' \
 glinescopy.lst|74| hg commit -A -m 'Added ignored10.lst' \
 glinescopy.lst|76| hg commit -A -m 'Added .hgignore' \
-aurum://file:%TMPDIR%/test/greprepo:24:flines.lst|5| hg commit -m 'Merge from A' \
+aurum://file:%ETMPDIR%%-test%-greprepo:24:flines.lst|5| hg commit -m 'Merge from A' \
 nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
 nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
 nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
 glinescopy.lst|72| hg commit -A -m 'Added nohglinesrev.lst' \
 glinescopy.lst|74| hg commit -A -m 'Added ignored10.lst' \
 glinescopy.lst|76| hg commit -A -m 'Added .hgignore' \
-aurum://file:%TMPDIR%/test/greprepo:24:flines.lst|5| hg commit -m 'Merge from A' \
+aurum://file:%ETMPDIR%%-test%-greprepo:24:flines.lst|5| hg commit -m 'Merge from A' \
 nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
 nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
 nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
 hglines.lst|39| hg commit -A -m 'Added ignored10.lst' \
 hglines.lst|40| hg commit -A -m 'Added .hgignore' \
 {{{1 A\b revrange 2 10
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|4| local A='A <a@example.com>'
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|13| hg commit -A -m 'Added «createrepo.zsh»' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|14| --date '1999-01-02 5:20' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|16| hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|17| --date '2000-01-05 7:30' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|22| hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|26| hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|27| --date '2000-05-10 4:23' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|28| hg branch A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|30| hg commit -A -m 'Added dlines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|34| hg commit -A -m 'Added alines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|35| --date '2000-11-02 5:44' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|38| hg commit -A -m 'Added ablines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|48| hg commit -A -m 'Added blines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|49| --date '2001-02-01 05:18' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|51| --date '2001-02-01 05:19' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|54| hg commit -A -m 'Added clines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|58| hg update A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|69| hg merge -r A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|70| hg commit -m 'Merge from A' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|73| hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|74| --date '2002-02-10 05:00' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|76| hg commit -A -m 'Added nohglines.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|79| hg commit -A -m 'Added nohglinesrev.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|82| hg commit -A -m 'Added ignored10.lst' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|83| --date '2002-02-11 03:15' --user $A
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|85| hg commit -A -m 'Added .hgignore' \
-aurum://file:%TMPDIR%/test/greprepo:2:crepo.zsh|86| --date '2002-02-11 05:43' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|4| local A='A <a@example.com>'
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|13| hg commit -A -m 'Added «createrepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|14| --date '1999-01-02 5:20' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|16| hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|17| --date '2000-01-05 7:30' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|22| hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|26| hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|27| --date '2000-05-10 4:23' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|28| hg branch A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|30| hg commit -A -m 'Added dlines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|34| hg commit -A -m 'Added alines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|35| --date '2000-11-02 5:44' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|38| hg commit -A -m 'Added ablines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|48| hg commit -A -m 'Added blines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|49| --date '2001-02-01 05:18' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|51| --date '2001-02-01 05:19' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|54| hg commit -A -m 'Added clines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|58| hg update A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|69| hg merge -r A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|70| hg commit -m 'Merge from A' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|73| hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|74| --date '2002-02-10 05:00' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|76| hg commit -A -m 'Added nohglines.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|79| hg commit -A -m 'Added nohglinesrev.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|82| hg commit -A -m 'Added ignored10.lst' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|83| --date '2002-02-11 03:15' --user $A
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|85| hg commit -A -m 'Added .hgignore' \
+aurum://file:%ETMPDIR%%-test%-greprepo:2:crepo.zsh|86| --date '2002-02-11 05:43' --user $A
 chgrepo.zsh|4| local A='A <a@example.com>'
 chgrepo.zsh|13| hg commit -A -m 'Added «createrepo.zsh»' \
 chgrepo.zsh|14| --date '1999-01-02 5:20' --user $A
 %TMPDIR%/test/testrepo/glinescopy.lst|72| hg commit -A -m 'Added nohglinesrev.lst' \
 %TMPDIR%/test/testrepo/glinescopy.lst|74| hg commit -A -m 'Added ignored10.lst' \
 %TMPDIR%/test/testrepo/glinescopy.lst|76| hg commit -A -m 'Added .hgignore' \
-aurum://file:%TMPDIR%/test/testrepo:24:flines.lst|5| hg commit -m 'Merge from A' \
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|19| A$ resu-- '32:4 01-50-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|23| A$ resu-- '44:5 20-11-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|29| A$ resu-- '81:50 10-20-1002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|30| A$ resu-- '91:50 10-20-1002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|38| A$ resu-- '00:50 01-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|44| A$ resu-- '51:30 11-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|46| A$ resu-- '34:50 11-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|51| cbaderongi > 'cbA' ohce    
+aurum://file:%ETMPDIR%%-test%-testrepo:24:flines.lst|5| hg commit -m 'Merge from A' \
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|19| A$ resu-- '32:4 01-50-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|23| A$ resu-- '44:5 20-11-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|29| A$ resu-- '81:50 10-20-1002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|30| A$ resu-- '91:50 10-20-1002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|38| A$ resu-- '00:50 01-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|44| A$ resu-- '51:30 11-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|46| A$ resu-- '34:50 11-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|51| cbaderongi > 'cbA' ohce    
 %TMPDIR%/test/testrepo/nohglines.lst|4| local A='A <a@example.com>'
 %TMPDIR%/test/testrepo/nohglines.lst|12| --date '1999-01-02 5:20' --user $A
 %TMPDIR%/test/testrepo/nohglines.lst|13| --date '2000-01-05 7:30' --user $A
 %TMPDIR%/test/testrepo/nohglines.lst|38| --date '2002-02-10 05:00' --user $A
 %TMPDIR%/test/testrepo/nohglines.lst|44| --date '2002-02-11 03:15' --user $A
 %TMPDIR%/test/testrepo/nohglines.lst|46| --date '2002-02-11 05:43' --user $A
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|2| hg commit -A -m 'Added «createrepo.zsh»' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|4| hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|7| hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|8| hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|9| hg branch A
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|10| hg commit -A -m 'Added dlines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|12| hg commit -A -m 'Added alines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|14| hg commit -A -m 'Added ablines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|20| hg commit -A -m 'Added blines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|23| hg commit -A -m 'Added clines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|25| hg update A
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|33| hg merge -r A
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|34| hg commit -m 'Merge from A' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|36| hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|37| hg commit -A -m 'Added nohglines.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|38| hg commit -A -m 'Added nohglinesrev.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|39| hg commit -A -m 'Added ignored10.lst' \
-aurum://file:%TMPDIR%/test/testrepo:18:hglines2.lst|40| hg commit -A -m 'Added .hgignore' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|2| hg commit -A -m 'Added «createrepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|4| hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|7| hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|8| hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|9| hg branch A
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|10| hg commit -A -m 'Added dlines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|12| hg commit -A -m 'Added alines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|14| hg commit -A -m 'Added ablines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|20| hg commit -A -m 'Added blines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|23| hg commit -A -m 'Added clines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|25| hg update A
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|33| hg merge -r A
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|34| hg commit -m 'Merge from A' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|36| hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|37| hg commit -A -m 'Added nohglines.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|38| hg commit -A -m 'Added nohglinesrev.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|39| hg commit -A -m 'Added ignored10.lst' \
+aurum://file:%ETMPDIR%%-test%-testrepo:18:hglines2.lst|40| hg commit -A -m 'Added .hgignore' \
 %TMPDIR%/test/testrepo/clines.lst|17| hg branch A
 %TMPDIR%/test/testrepo/clines.lst|20| hg commit -A -m 'Added ablines.lst' \
 %TMPDIR%/test/testrepo/clines.lst|21| hg commit -A -m 'Added alines.lst' \
 %TMPDIR%/test/testrepo/chgrepo.zsh|85| hg commit -A -m 'Added .hgignore' \
 %TMPDIR%/test/testrepo/chgrepo.zsh|86| --date '2002-02-11 05:43' --user $A
 {{{1 A\b files ../testrepo/nohglinesrev.lst
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|19| A$ resu-- '32:4 01-50-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|23| A$ resu-- '44:5 20-11-0002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|29| A$ resu-- '81:50 10-20-1002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|30| A$ resu-- '91:50 10-20-1002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|38| A$ resu-- '00:50 01-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|44| A$ resu-- '51:30 11-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|46| A$ resu-- '34:50 11-20-2002' etad--        
-aurum://file:%TMPDIR%/test/testrepo:20:nohglinesrev.lst|51| cbaderongi > 'cbA' ohce    
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|4| '>moc.elpmaxe@a< A'=A lacol
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|12| A$ resu-- '02:5 20-10-9991' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|13| A$ resu-- '03:7 50-10-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|19| A$ resu-- '32:4 01-50-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|23| A$ resu-- '44:5 20-11-0002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|29| A$ resu-- '81:50 10-20-1002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|30| A$ resu-- '91:50 10-20-1002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|38| A$ resu-- '00:50 01-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|44| A$ resu-- '51:30 11-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|46| A$ resu-- '34:50 11-20-2002' etad--        
+aurum://file:%ETMPDIR%%-test%-testrepo:20:nohglinesrev.lst|51| cbaderongi > 'cbA' ohce    
 {{{1 A\b revision 4 files ../testrepo/*.lst
 %TMPDIR%/test/testrepo/datelines.lst|2| hg commit -A -m 'Added «createrepo.zsh»' \
 %TMPDIR%/test/testrepo/datelines.lst|4| hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
 %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 /bin/zsh noworkmatch files createrepo.zsh
-aurum://file:%TMPDIR%/test/greprepo:0:createrepo.zsh|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-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
-aurum://file:%TMPDIR%/test/greprepo:3:chgrepo.zsh|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:19:nohglines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:10:blines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:3:chgrepo.zsh|1| #!/bin/zsh
 {{{1 /bin/zsh
-aurum://file:%TMPDIR%/test/greprepo:19:nohglines.lst|1| #!/bin/zsh
-aurum://file:%TMPDIR%/test/greprepo:10:blines.lst|1| #!/bin/zsh
-aurum://file:%TMPDIR%/test/greprepo:3:chgrepo.zsh|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:19:nohglines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:10:blines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:3:chgrepo.zsh|1| #!/bin/zsh
 {{{1 /bin/zsh wdfiles
 nohglines.lst|1| #!/bin/zsh
 blines.lst|1| #!/bin/zsh
 blines.lst|1| #!/bin/zsh
 chgrepo.zsh|1| #!/bin/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
-aurum://file:%TMPDIR%/test/greprepo:3:chgrepo.zsh|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:19:nohglines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:10:blines.lst|1| #!/bin/zsh
+aurum://file:%ETMPDIR%%-test%-greprepo:3:chgrepo.zsh|1| #!/bin/zsh
 >>> Messages:
 Frawor:plugin/aurum:nogf:No files found
 <<< Messages^
+wine

File test/logmaps.ok

 {{{1 <CR>
-aurum://diff:%TMPDIR%/test/logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:
+aurum://diff:%ETMPDIR%%-test%-logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:
 {{{1 branch <CR>
-aurum://log:%TMPDIR%/test/logmapsrepo:branch:A,crrestrict:branch
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:branch:A,crrestrict:branch
 {{{1 user <CR>
-aurum://log:%TMPDIR%/test/logmapsrepo:user:\VA <a@example.com>,crrestrict:user
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:user:%+VA <a@example.com>,crrestrict:user
 {{{1 date <CR>
-aurum://log:%TMPDIR%/test/logmapsrepo:date:2002-02,crrestrict:date
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:date:2002-02,crrestrict:date
 {{{1 changeset <CR>
-aurum://log:%TMPDIR%/test/logmapsrepo:revision:df55ab32bcfa13929c53541c105b2b20972cb51b,crrestrict:revision
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:revision:df55ab32bcfa13929c53541c105b2b20972cb51b,crrestrict:revision
 {{{1 gF
-aurum://log:%TMPDIR%/test/logmapsrepo:showfiles:1,files:glines.lst,crrestrict:files
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:showfiles:1,files:glines.lst,crrestrict:files
 {{{1 gF+files
-aurum://log:%TMPDIR%/test/logmapsrepo:showfiles:1,files:.hgignore,crrestrict:files
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:showfiles:1,files:.hgignore,crrestrict:files
 {{{1 gu
-aurum://log:%TMPDIR%/test/logmapsrepo:user:\VA <a@example.com>,crrestrict:user
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:user:%+VA <a@example.com>,crrestrict:user
 {{{1 gD
-aurum://log:%TMPDIR%/test/logmapsrepo:date:2002-02,crrestrict:date
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:date:2002-02,crrestrict:date
 {{{1 gb
-aurum://log:%TMPDIR%/test/logmapsrepo:branch:A,crrestrict:branch
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:branch:A,crrestrict:branch
 {{{1 gr
-aurum://log:%TMPDIR%/test/logmapsrepo:revision:be92227e3e43f4e7402408afe110098d209d2568,crrestrict:revision
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:revision:be92227e3e43f4e7402408afe110098d209d2568,crrestrict:revision
 {{{1 gd
-aurum://diff:%TMPDIR%/test/logmapsrepo::dfe39aa48c6ddde158e42217548b531a45ff66e9
+aurum://diff:%ETMPDIR%%-test%-logmapsrepo::dfe39aa48c6ddde158e42217548b531a45ff66e9
 {{{1 gc
-aurum://diff:%TMPDIR%/test/logmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:
+aurum://diff:%ETMPDIR%%-test%-logmapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:
 {{{1 d
-aurum://diff:%TMPDIR%/test/logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9::crepo.zsh
+aurum://diff:%ETMPDIR%%-test%-logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9::crepo.zsh
 w$: 1
 {{{1 c
-aurum://diff:%TMPDIR%/test/logmapsrepo::dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+aurum://diff:%ETMPDIR%%-test%-logmapsrepo::dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
 w$: 1
 {{{1 D
-aurum://file:%TMPDIR%/test/logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
 w$: 2
 {{{1 C
-aurum://file:%TMPDIR%/test/logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
 w$: 2
 {{{1 o+files
-aurum://file:%TMPDIR%/test/logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
 {{{1 o
-aurum://file:%TMPDIR%/test/logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
 {{{1 cancel o
-aurum://log:%TMPDIR%/test/logmapsrepo:showfiles:1,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:showfiles:1,
 {{{1 a+files
-aurum://file:%TMPDIR%/test/logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
-aurum://annotate:%TMPDIR%/test/logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
+aurum://annotate:%ETMPDIR%%-test%-logmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:.hgignore
 w$: 2
 {{{1 a
-aurum://file:%TMPDIR%/test/logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
-aurum://annotate:%TMPDIR%/test/logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
+aurum://file:%ETMPDIR%%-test%-logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
+aurum://annotate:%ETMPDIR%%-test%-logmapsrepo:d8140c0b7b0b670bafe0891bcf0c4582092de884:glines.lst
 w$: 2
 {{{1 cancel a
-aurum://log:%TMPDIR%/test/logmapsrepo:showfiles:1,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:showfiles:1,
 {{{1 K, J
 | | o | |  Changeset 8:250ba7cd831ee91c3ba5bef1faebc38c5dbca5f8 (branch C)
 | | o  Changeset 6:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe (branch B)

File test/prevmessage.in

 all
 files
 ,i:WT
-:R !hg rollback
+:R silent! !hg rollback
 :R AuCommit **
 ,i:WT
 :let g:aurum_remembermsg=0

File test/statmaps.ok

 {{{1 <CR>
 *1: %TMPDIR%/test/statmapsrepo/nohglinesrev.lst
 {{{1 o
-*1: aurum://file:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+*1: aurum://file:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 {{{1 gc
-*1: aurum://diff:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:
+*1: aurum://diff:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:
 {{{1 c
-*1: aurum://diff:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b::nohglinesrev.lst
+*1: aurum://diff:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b::nohglinesrev.lst
 {{{1 C
-*1: aurum://file:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+*1: aurum://file:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 #2: %TMPDIR%/test/statmapsrepo/nohglinesrev.lst
 d: 1
 {{{1 gd
-*1: aurum://diff:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b
+*1: aurum://diff:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b
 {{{1 d
-*1: aurum://diff:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b::nohglinesrev.lst
+*1: aurum://diff:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b::nohglinesrev.lst
 {{{1 D
-*1: aurum://file:%TMPDIR%/test/statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+*1: aurum://file:%ETMPDIR%%-test%-statmapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 #2: %TMPDIR%/test/statmapsrepo/nohglinesrev.lst
 d: 1
 {{{1 i

File test/vimdiff-usewin.ok

 vimdiff-usewinrepo/nohglinesrev.lst
 w0: 2; w$: 3
-aurum://file:%TMPDIR%/test/vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+aurum://file:%ETMPDIR%%-test%-vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 w0: 1; w$: 3
 vimdiff-usewinrepo/nohglinesrev.lst
 w0: 1; w$: 2
-aurum://file:%TMPDIR%/test/vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+aurum://file:%ETMPDIR%%-test%-vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 w0: 2; w$: 2
 vimdiff-usewinrepo/nohglinesrev.lst
 w0: 1; w$: 2
-aurum://file:%TMPDIR%/test/vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+aurum://file:%ETMPDIR%%-test%-vimdiff-usewinrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 w0: 2; w$: 2

File test/vimdiff.ok

 {{{1 status
-#1: aurum://file:%TMPDIR%/test/vimdiffrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+#1: aurum://file:%ETMPDIR%%-test%-vimdiffrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 *2: %TMPDIR%/test/vimdiffrepo/nohglinesrev.lst
  3: 
- 4: aurum://status:%TMPDIR%/test/vimdiffrepo:
+ 4: aurum://status:%ETMPDIR%%-test%-vimdiffrepo:
 {{{1 file
-#1: aurum://file:%TMPDIR%/test/testrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
+#1: aurum://file:%ETMPDIR%%-test%-testrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:nohglinesrev.lst
 *2: %TMPDIR%/test/testrepo/nohglinesrev.lst
 {{{1 file+rev
-#1: aurum://file:%TMPDIR%/test/testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
 *2: %TMPDIR%/test/testrepo/chgrepo.zsh
 {{{1 file+rev+rev
-#1: aurum://file:%TMPDIR%/test/testrepo:462a1e95be86f96aaf6d7360f6f770826c3eb641:chgrepo.zsh
-*2: aurum://file:%TMPDIR%/test/testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-testrepo:462a1e95be86f96aaf6d7360f6f770826c3eb641:chgrepo.zsh
+*2: aurum://file:%ETMPDIR%%-test%-testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
 {{{1 file+rev+rev+curfile
-#1: aurum://file:%TMPDIR%/test/testrepo:462a1e95be86f96aaf6d7360f6f770826c3eb641:chgrepo.zsh
- 2: aurum://file:%TMPDIR%/test/testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
+#1: aurum://file:%ETMPDIR%%-test%-testrepo:462a1e95be86f96aaf6d7360f6f770826c3eb641:chgrepo.zsh
+ 2: aurum://file:%ETMPDIR%%-test%-testrepo:f44a21859e57e4abc6155da804d08dd5069e798e:chgrepo.zsh
 *3: %TMPDIR%/test/testrepo/chgrepo.zsh
         execute 'silent cd' fnameescape(reporoot)
     endif
     execute a:cmd
-    if exists('g:postcmd')
-        execute 'silent' g:postcmd
-    endif
-    if !a:bang
-        execute 'silent cd' fnameescape(olddir)
-    endif
-    if a:write
-        execute 'silent write! >> '.fnameescape(s:outfile)
-    endif
+    try
+        if exists('g:postcmd')
+            execute 'silent' g:postcmd
+        endif
+    finally
+        if !a:bang
+            execute 'silent cd' fnameescape(olddir)
+        endif
+        if a:write
+            execute 'silent write! >> '.fnameescape(s:outfile)
+        endif
+    endtry
 endfunction
 command -nargs=1 -bang Run :call s:Run(<bang>0, 1, <q-args>)
 command -nargs=1 -bang R   :call s:Run(<bang>0, 0, <q-args>)

File test/wine/annotate.ok

Binary file added.

File test/wine/aufilemaps.ok

+0
+aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+1
+aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:df55ab32bcfa13929c53541c105b2b20972cb51b:chgrepo.zsh
+=aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+*1: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+#2: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+aurum:\\diff:%TMPDIR%\\test\\aufilemapsrepo::5a6a1bf999fad1f4547eeb887af54f31d11833f2::
+aurum:\\diff:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:dfe39aa48c6ddde158e42217548b531a45ff66e9::
+::: D
+*1: T:\test\aufilemapsrepo\crepo.zsh
+#2: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+::: C
+#1: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:dfe39aa48c6ddde158e42217548b531a45ff66e9:crepo.zsh
+*2: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh
+::: ,X
+*1: aurum:\\file:%TMPDIR%\\test\\aufilemapsrepo:5a6a1bf999fad1f4547eeb887af54f31d11833f2:crepo.zsh

File test/wine/diff.ok

+{{{1
+diff -r df55ab32bcfa addeddef
+--- /dev/null
++++ b/addeddef
+@@ -0,0 +1,1 @@
++Def
+diff -r df55ab32bcfa hglines2.lst
+--- a/hglines2.lst
++++ /dev/null
+@@ -1,41 +0,0 @@
+-    hg init testrepo
+-    hg commit -A -m 'Added «createrepo.zsh»' \
+-    hg mv createrepo.zsh crepo.zsh
+-    hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+-    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+-    hg mv crepo.zsh chgrepo.zsh
+-    hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+-    hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+-    hg branch A
+-    hg commit -A -m 'Added dlines.lst' \
+-    hg branch B
+-    hg commit -A -m 'Added alines.lst' \
+-    hg branch C
+-    hg commit -A -m 'Added ablines.lst' \
+-    hg tag ablines \
+-    hg update default
+-    hg merge -r ablines
+-    hg commit -m 'Merge from C' \
+-    hg update C
+-    hg commit -A -m 'Added blines.lst' \
+-    hg tag blines \
+-    hg update -r -2
+-    hg commit -A -m 'Added clines.lst' \
+-    hg tag clines \
+-    hg update A
+-    hg merge -r B
+-    hg commit -m 'Merge from B' \
+-    hg merge -r clines
+-    hg commit -m 'Merge from C:2' \
+-    hg update default
+-    hg merge -r blines
+-    hg commit -m 'Merge from C:1' \
+-    hg merge -r A
+-    hg commit -m 'Merge from A' \
+-    hg cp hglines.lst hglines2.lst
+-    hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
+-    hg commit -A -m 'Added nohglines.lst' \
+-    hg commit -A -m 'Added nohglinesrev.lst' \
+-    hg commit -A -m 'Added ignored10.lst' \
+-    hg commit -A -m 'Added .hgignore' \
+-    hg rm hglines2.lst
+diff -r df55ab32bcfa nohglinesrev.lst
+--- a/nohglinesrev.lst
++++ b/nohglinesrev.lst
+@@ -51,3 +51,4 @@
+ cbaderongi > 'cbA' ohce    
+ }
+ opertset zx.rat.opertset fJc rat
++abc
+w$: 1
+{{{1 cmd
+diff -r df55ab32bcfa addeddef
+--- /dev/null
++++ b/addeddef
+@@ -0,0 +1,1 @@
++Def
+diff -r df55ab32bcfa hglines2.lst
+--- a/hglines2.lst
++++ /dev/null
+@@ -1,41 +0,0 @@
+-    hg init testrepo
+-    hg commit -A -m 'Added «createrepo.zsh»' \
+-    hg mv createrepo.zsh crepo.zsh
+-    hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+-    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+-    hg mv crepo.zsh chgrepo.zsh
+-    hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+-    hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+-    hg branch A
+-    hg commit -A -m 'Added dlines.lst' \
+-    hg branch B
+-    hg commit -A -m 'Added alines.lst' \
+-    hg branch C
+-    hg commit -A -m 'Added ablines.lst' \
+-    hg tag ablines \
+-    hg update default
+-    hg merge -r ablines
+-    hg commit -m 'Merge from C' \
+-    hg update C
+-    hg commit -A -m 'Added blines.lst' \
+-    hg tag blines \
+-    hg update -r -2
+-    hg commit -A -m 'Added clines.lst' \
+-    hg tag clines \
+-    hg update A
+-    hg merge -r B
+-    hg commit -m 'Merge from B' \
+-    hg merge -r clines
+-    hg commit -m 'Merge from C:2' \
+-    hg update default
+-    hg merge -r blines
+-    hg commit -m 'Merge from C:1' \
+-    hg merge -r A
+-    hg commit -m 'Merge from A' \
+-    hg cp hglines.lst hglines2.lst
+-    hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
+-    hg commit -A -m 'Added nohglines.lst' \
+-    hg commit -A -m 'Added nohglinesrev.lst' \
+-    hg commit -A -m 'Added ignored10.lst' \
+-    hg commit -A -m 'Added .hgignore' \
+-    hg rm hglines2.lst
+diff -r df55ab32bcfa nohglinesrev.lst
+--- a/nohglinesrev.lst
++++ b/nohglinesrev.lst
+@@ -51,3 +51,4 @@
+ cbaderongi > 'cbA' ohce    
+ }
+ opertset zx.rat.opertset fJc rat
++abc
+w$: 2
+{{{1 changes
+diff -r 67cf252de26b -r e85aa09aab16 ignored10.lst
+--- /dev/null
++++ b/ignored10.lst
+@@ -0,0 +1,10 @@
++1
++2
++3
++4
++5
++6
++7
++8
++9
++10
+{{{1 rev1
+diff -r 67cf252de26b -r e85aa09aab16 ignored10.lst
+--- /dev/null
++++ b/ignored10.lst
+@@ -0,0 +1,10 @@
++1
++2
++3
++4
++5
++6
++7
++8
++9
++10
+{{{1 rev2
+diff -r df55ab32bcfa addeddef
+--- /dev/null
++++ b/addeddef
+@@ -0,0 +1,1 @@
++Def
+diff -r df55ab32bcfa hglines2.lst
+--- a/hglines2.lst
++++ /dev/null
+@@ -1,41 +0,0 @@
+-    hg init testrepo
+-    hg commit -A -m 'Added «createrepo.zsh»' \
+-    hg mv createrepo.zsh crepo.zsh
+-    hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+-    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+-    hg mv crepo.zsh chgrepo.zsh
+-    hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+-    hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+-    hg branch A
+-    hg commit -A -m 'Added dlines.lst' \
+-    hg branch B
+-    hg commit -A -m 'Added alines.lst' \
+-    hg branch C
+-    hg commit -A -m 'Added ablines.lst' \
+-    hg tag ablines \
+-    hg update default
+-    hg merge -r ablines
+-    hg commit -m 'Merge from C' \
+-    hg update C
+-    hg commit -A -m 'Added blines.lst' \
+-    hg tag blines \
+-    hg update -r -2
+-    hg commit -A -m 'Added clines.lst' \
+-    hg tag clines \
+-    hg update A
+-    hg merge -r B
+-    hg commit -m 'Merge from B' \
+-    hg merge -r clines
+-    hg commit -m 'Merge from C:2' \
+-    hg update default
+-    hg merge -r blines
+-    hg commit -m 'Merge from C:1' \
+-    hg merge -r A
+-    hg commit -m 'Merge from A' \
+-    hg cp hglines.lst hglines2.lst
+-    hg commit -A -m 'Copied “hglines.lst” to “hglines2.lst”' \
+-    hg commit -A -m 'Added nohglines.lst' \
+-    hg commit -A -m 'Added nohglinesrev.lst' \
+-    hg commit -A -m 'Added ignored10.lst' \
+-    hg commit -A -m 'Added .hgignore' \
+-    hg rm hglines2.lst
+diff -r df55ab32bcfa nohglinesrev.lst
+--- a/nohglinesrev.lst
++++ b/nohglinesrev.lst
+@@ -51,3 +51,4 @@
+ cbaderongi > 'cbA' ohce    
+ }
+ opertset zx.rat.opertset fJc rat
++abc
+{{{1 rev1 + rev2
+diff -r df55ab32bcfa -r e85aa09aab16 .hgignore
+--- a/.hgignore
++++ /dev/null
+@@ -1,2 +0,0 @@
+-syntax: glob
+-ignored*
+diff -r df55ab32bcfa -r e85aa09aab16 .hgtags
+--- a/.hgtags
++++ b/.hgtags
+@@ -1,2 +1,1 @@
+ c06107b7bcbe751d2dd40faf4179ee7d6aac44ac ablines
+-023aa55bd8062179ce36adbdd78363e9b88718c1 oldtag
+diff -r df55ab32bcfa -r e85aa09aab16 emerged.lst
+--- a/emerged.lst
++++ /dev/null
+@@ -1,127 +0,0 @@
+-<<<<<<< local
+-=======
+-emulate -L zsh
+-set -e
+-local A='A <a@example.com>'
+-local B='B <b@example.org>'
+-local C='C <c@example.gov>'
+-    set -e
+->>>>>>> other
+-    hg init testrepo
+-    cd testrepo
+-    cp ../createrepo.zsh .
+-<<<<<<< local
+-=======
+-    # XXX Date test will work only till 2099
+->>>>>>> other
+-    hg commit -A -m 'Added «createrepo.zsh»' \
+-<<<<<<< local
+-=======
+-        --date '1999-01-02 5:20' --user $A
+->>>>>>> other
+-    hg mv createrepo.zsh crepo.zsh
+-    hg commit -A -m 'Renamed «createrepo.zsh» to «crepo.zsh»' \
+-<<<<<<< local
+-=======
+-        --date '2000-01-05 7:30' --user $A
+->>>>>>> other
+-    perl -p -i -e 'tr/{}/{}/' crepo.zsh
+-    hg commit -m $'Replaced\n    {\n        ...\n    }\nwith\n    {\n        ...\n    }' \
+-<<<<<<< local
+-=======
+-        --date '2000-01-15 15:00' --user $B
+->>>>>>> other
+-    hg mv crepo.zsh chgrepo.zsh
+-    hg commit -A -m 'Renamed «crepo.zsh» to «chgrepo.zsh»' \
+-<<<<<<< local
+-=======
+-        --date '2000-02-01 14:00' --user $B
+->>>>>>> other
+-    cat chgrepo.zsh | perl -p -i -e 'undef $_ unless /^    hg /' > hglines.lst
+-    cat chgrepo.zsh | perl -p -i -e 'undef $_ unless /^    hg /' > datelines.lst
+-<<<<<<< local
+-=======
+-    hg commit -A -m 'Added «hglines.lst» and «datelines.lst»' \
+-        --date '2000-05-10 4:23' --user $A
+->>>>>>> other
+-    cat chgrepo.zsh | grep 'd' > dlines.lst
+-<<<<<<< local
+-=======
+-    hg commit -A -m 'Added dlines.lst' \
+-        --date '2000-11-01 13:24' --user $B
+->>>>>>> other
+-    cat chgrepo.zsh | grep 'a' > alines.lst
+-<<<<<<< local
+-=======
+-    hg commit -A -m 'Added alines.lst' \
+-        --date '2000-11-02 5:44' --user $A
+->>>>>>> other
+-    cat alines.lst | grep 'b' > ablines.lst
+-<<<<<<< local
+-=======
+-    hg commit -A -m 'Added ablines.lst' \
+-        --date '2000-11-02 14:13' --user $B
+-    hg tag ablines \
+-        --date '2000-11-02 14:14' --user $B
+-    hg update default
+-    hg merge -r ablines