ZyX_I avatar ZyX_I committed 61b8a16

Made rf-getchangesets return repo.cslist, purged direct usage of repo.cslist out of @aurum/log and @aurum

Comments (0)

Files changed (7)

                    completion in commands that accept {rev} argument.
     url            Remote repository URL. For mercurial it is either 
                    paths.default-push or paths.default whichever is defined.
-  getchangesets :: () -> {hex : cs}                   *aurum-rf-getchangesets*
+  getchangesets :: () -> [ cs ]                       *aurum-rf-getchangesets*
     Pull all changesets contained in repository into |aurum-repo.changesets| 
     dictionary. If this function is not called, then |aurum-repo.changesets| 
-    dictionary contains only changesets that were used at least ones.
+    dictionary contains only changesets that were used at least ones. Returns 
+    list of changesets as contained in |aurum-repo.cslist|.
   getcs :: hex -> cs                                          *aurum-rf-getcs*
     Returns |aurum-changeset| object which has given hash. See also 
     |aurum-cs.hex|.
     Get changeset hash of the last revision in a repository.
   getworkhex :: () -> hex                                *aurum-rf-getworkhex*
     Get changeset hash of the working directory revision.
-  getwork:: () -> cs                                        *aurum-rf-getwork*
+  getwork :: () -> cs                                       *aurum-rf-getwork*
     Get changeset object for the working directory revision.
   updatechangesets :: () -> _                      *aurum-rf-updatechangesets*
     Updates data stored in repository. Is called automatically when you get 
     if has_key(a:opts, 'files')
         if empty(revisions)
             if get(a:opts, 'workmatch', 1)
-                let cslist=[repo.functions.getwork(repo)]
+                let css=[repo.functions.getwork(repo)]
             else
-                call repo.functions.getchangesets(repo)
-                let cslist=repo.cslist[:-2]
+                let css=repo.functions.getchangesets(repo)[:-2]
             endif
         else
-            let cslist=[]
+            let css=[]
             for r in revisions
                 if type(r)==type([])
-                    let cslist+=map(call('range', r),
-                                \   'repo.functions.getcs(repo, v:val)')
+                    let css+=map(call('range', r),
+                                \'repo.functions.getcs(repo, v:val)')
                 else
-                    let cslist+=[repo.functions.getcs(repo, r)]
+                    let css+=[repo.functions.getcs(repo, r)]
                 endif
                 unlet r
             endfor
         endif
-        let allfiless=map(copy(cslist), 'repo.functions.getcsprop(repo, v:val,'.
-                    \                                            '"allfiles")')
+        let allfiless=map(copy(css), 'repo.functions.getcsprop(repo, v:val,'.
+                    \                                         '"allfiles")')
         let allfiles=[]
         call map(copy(allfiless),
                     \'extend(allfiles, filter(v:val, '.

plugin/aurum/cmdutils.vim

     elseif a:failmsg isnot 0
         call s:_f.throw(a:failmsg)
     endif
+    "▶2 Update repository if appropriate
+    if exists('repo') && exists('bvar.repo') &&
+                \repo is bvar.repo && !empty(repo.cslist)
+        call repo.functions.updatechangesets(repo)
+    endif
+    "▲2
     if a:ann!=-1
         "▶2 repo
         if !exists('repo')

plugin/aurum/drivers/mercurial.vim

 "▶1 hg.getchangesets :: repo → changesets + repo.changesets
 function s:hg.getchangesets(repo)
     call a:repo.functions.updatechangesets(a:repo)
-    return a:repo.changesets
+    return a:repo.cslist
 endfunction
 "▶1 hg.getrevhex :: repo, rev → rev(hex)
 if s:usepythondriver "▶2

plugin/aurum/edit.vim

             let &eventignore=savedei
         endtry
         setlocal modifiable noreadonly
-        " FIXME Check how this interacts with changes made after repository
-        "       object was created
         silent call s:F.runcmd(s:commands[a:command], file, [0, a:repo]+a:000)
         if a:vcommand[:2] isnot# 'sil'
             file

plugin/aurum/log.vim

     return r
 endfunction
 "▶2 glog.graphlog
-function s:F.glog.graphlog(repo, opts)
-    let css=reverse(a:repo.cslist[a:opts.revs[0]:a:opts.revs[1]])
+function s:F.glog.graphlog(repo, opts, css)
+    let css=reverse(copy(a:css))
     let a:opts.repo=a:repo
     return s:F.glog.generate(css, [a:repo.functions.getworkhex(a:repo)], a:opts)
 endfunction
 function s:F.setup(read, repo, opts)
     let opts=a:opts
     let bvar={}
-    call a:repo.functions.getchangesets(a:repo)
+    let cslist=a:repo.functions.getchangesets(a:repo)
     "▶2 Add `ignorefiles'
     let ignorefiles=(has_key(opts, 'ignfiles')?
                 \               (opts.ignfiles):
         endwhile
     endif
     "▲2
-    let cslist=a:repo.cslist[opts.revs[0]:opts.revs[1]]
+    let css=cslist[opts.revs[0]:opts.revs[1]]
     "▶2 Generate cs.{kw} for various options (`show{kw}'+`files')
     for key in ['renames', 'copies']
         if get(opts, 'show'.key, 0) || has_key(opts, 'files')
-            for cs in cslist
+            for cs in css
                 call a:repo.functions.getcsprop(a:repo, cs, key)
             endfor
         endif
                 \                     get(opts, 'showcopies',  0) ||
                 \                     get(opts, 'showfiles',   0) ||
                 \                     get(opts, 'stat',        0)
-        for cs in cslist
+        for cs in css
             call a:repo.functions.getcsprop(a:repo, cs, 'files')
         endfor
     endif
     "▶2 Generate cs.changes for showfiles option
     if get(opts, 'showfiles', 0)
-        for cs in cslist
+        for cs in css
             call a:repo.functions.getcsprop(a:repo, cs, 'changes')
         endfor
     endif
     "▶2 Generate file lists for `files' option
     if has_key(opts, 'files')
         let opts.csfiles={}
-        for cs in cslist
+        for cs in css
             let changes=a:repo.functions.getcsprop(a:repo,cs, 'changes')
             let changes=copy(changes)
             let csfiles=[]
     let foundfirst=0
     let lastnoskip=-1
     let i=opts.revs[0]
-    for cs in cslist
+    for cs in css
         let skip=0
         "▶3 `branch', `merges', `search', `user', `revision'
         if (has_key(opts, 'branch') && cs.branch isnot# opts.branch)||
     let opts.templatefunc=s:F.temp.compile(bvar.templatelist,
                 \                               opts)
     "▲2
-    let cslist=a:repo.cslist[opts.revs[0]:opts.revs[1]]
-    let text=s:F.glog.graphlog(a:repo, opts)
+    let css=cslist[opts.revs[0]:opts.revs[1]]
+    let text=s:F.glog.graphlog(a:repo, opts, css)
     let bvar.specials=text.specials
     let bvar.rectangles=text.rectangles
     let bvar.csstarts=text.csstarts

test/wine/vimdiff-full.ok

 {{{1 full
  1*1: 
 *2*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*2#2: vimdiff-fullrepo\nohglinesrev.lst
+*2#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 {{{1 ,X
 *1*1: 
 {{{1 noonlymodified
  1*1: 
  2*1: 
- 2#2: vimdiff-fullrepo\addeddef
+ 2#2: %TMPDIR%\test\vimdiff-fullrepo\addeddef
  3*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
  3#2: 
 *4*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*4#2: vimdiff-fullrepo\nohglinesrev.lst
+*4#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 {{{1 untracked
  1*1: 
  2*1: 
- 2#2: vimdiff-fullrepo\addeddef
+ 2#2: %TMPDIR%\test\vimdiff-fullrepo\addeddef
  3*1: 
- 3#2: vimdiff-fullrepo\hglinesrev.lst
+ 3#2: %TMPDIR%\test\vimdiff-fullrepo\hglinesrev.lst
  4*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
  4#2: 
  5*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
- 5#2: vimdiff-fullrepo\nohglinesrev.lst
+ 5#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 *6*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglines.lst
 *6#2: 
 {{{1 noonlymodified files *.lst
  1*1: 
  2*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
- 2#2: vimdiff-fullrepo\nohglinesrev.lst
+ 2#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 *3*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:hglines2.lst
 *3#2: 
 {{{1 files :
- 1*1: vimdiff-fullrepo\nohglinesrev.lst
+ 1*1: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 *2*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*2#2: vimdiff-fullrepo\nohglinesrev.lst
+*2#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
 {{{1 files repo/*.lst
  1*1: 
 *2*1: aurum:\\file:%ETMPDIR%%+test%+vimdiff-fullrepo:504f74154456dbb0e9441326514e42ce66279e62:nohglinesrev.lst
-*2#2: vimdiff-fullrepo\nohglinesrev.lst
+*2#2: %TMPDIR%\test\vimdiff-fullrepo\nohglinesrev.lst
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.