Commits

ZyX_I  committed d1ba036

@aurum/repo: Made it use check() on parents. Should partly fix ref #9 (except opts.limit support)

  • Participants
  • Parent commits f69e05a
  • Branches betterinterestingparents

Comments (0)

Files changed (2)

File plugin/aurum/log.vim

 "▶2 graph.update :: graph, cs → + graph
 function s:F.graph.update(cs)
     let self.cs=a:cs
-    let self.interesting_parents=filter(copy(a:cs.parents),
-                \                       '!has_key(self.skipchangesets, v:val)')
+    "▶3 Populate self.interesting_parents
+    let self.interesting_parents=[]
+    for parent in a:cs.parents
+        if has_key(self.skipchangesets, parent)
+            continue
+        elseif !s:iterfuncs.check.check(self.checkd,
+                    \              self.repo.functions.getcs(self.repo, parent))
+            let self.skipchangesets[parent]=1
+            continue
+        else
+            let self.interesting_parents+=[parent]
+        endif
+    endfor
+    "▲3
     let self.num_parents=len(self.interesting_parents)
     let self.prev_commit_index=self.commit_index
     call self.update_columns()
     let graph.repo=a:opts.repo
     let graph.workcss=a:showparents
     let graph.skipchangesets=a:opts.skipchangesets
+    let graph.checkd=a:opts.checkd
     call extend(graph, s:F.graph)
     return graph
 endfunction
         let a:bvar.specials=specials
         let a:bvar.csstarts=csstarts
         let a:opts.skipchangesets={}
+        let skipchangesets=a:opts.skipchangesets
         let didredraw=0
         let procinput=a:bvar.procinput
         let lastw0line=-1
         let lastline=0
     endif
     "▶3 Initialize iterator functions
+    let checkd=s:iterfuncs.check.start(a:repo, a:opts)
+    let a:opts.checkd=checkd
     let ld=literfuncs.start(a:repo,a:opts,[a:repo.functions.getworkhex(a:repo)])
     let csd=a:csiterfuncs.start(a:repo, a:opts)
-    let checkd=s:iterfuncs.check.start(a:repo, a:opts)
     "▲3
     while 1 && (!haslimit || limit)
         let cs=a:csiterfuncs.next(csd)
         if cs is 0 "▶3
             return r
         endif "▲3
-        let skip=!s:iterfuncs.check.check(checkd, cs)
+        let skip=has_key(skipchangesets, cs.hex) ||
+                    \!s:iterfuncs.check.check(checkd, cs)
         "▶3 Add cs to skipchangesets or get its properties
         if skip
-            let a:opts.skipchangesets[cs.hex]=cs
+            let skipchangesets[cs.hex]=1
         else
             call map(copy(reqprops),
                         \'a:repo.functions.getcsprop(a:repo, cs, v:val)')

File test/logmaps.ok

 {{{1 <CR>
 aurum://diff:%ETMPDIR%%-test%-logmapsrepo:504f74154456dbb0e9441326514e42ce66279e62:
 {{{1 branch <CR>
-aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:branch,branch:A,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:branch:A,crrestrict:branch,
 {{{1 user <CR>
 aurum://log:%ETMPDIR%%-test%-logmapsrepo:user:%+VA <a@example.com>,crrestrict:user,
 {{{1 date <CR>
 {{{1 gD
 aurum://log:%ETMPDIR%%-test%-logmapsrepo:date:2002-02,crrestrict:date,
 {{{1 gb
-aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:branch,branch:A,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:branch:A,crrestrict:branch,
 {{{1 gr
 aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:revision,revision:be92227e3e43f4e7402408afe110098d209d2568,
 {{{1 gd