Commits

ZyX_I  committed 7b84d48

Reverted merge

  • Participants
  • Parent commits a65a7be

Comments (0)

Files changed (3)

File plugin/aurum/log.vim

 "▶2 graph.update :: graph, cs → + graph
 function s:F.graph.update(cs)
     let self.cs=a:cs
-    "▶3 Populate self.interesting_parents
-    let self.interesting_parents=[]
-    for parent in a:cs.parents
-        if has_key(self.addchangesets, parent)
-            let self.interesting_parents+=[parent]
-        elseif has_key(self.skipchangesets, parent)
-        elseif !s:iterfuncs.check.check(self.checkd,
-                    \              self.repo.functions.getcs(self.repo, parent))
-            let self.skipchangesets[parent]=1
-        else
-            let self.addchangesets[parent]=1
-            let self.interesting_parents+=[parent]
-        endif
-    endfor
-    "▲3
+    let self.interesting_parents=filter(copy(a:cs.parents),
+                \                       '!has_key(self.skipchangesets, v:val)')
     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.addchangesets=a:opts.addchangesets
-    let graph.checkd=a:opts.checkd
     call extend(graph, s:F.graph)
     return graph
 endfunction
         let literfuncs=s:iterfuncs.hg
     endif
     "▶3 Initialize variables
-    let haslimit=(has_key(a:opts, 'limit') && a:opts.limit)
+    let haslimit=has_key(a:opts, 'limit')
     if haslimit
         let limit=a:opts.limit
     endif
     let csbuf=[]
     let reqprops=keys(a:opts.reqs)
     call filter(reqprops, 'index(a:repo.initprops, v:val)==-1')
-    let a:opts.skipchangesets={}
-    let skipchangesets=a:opts.skipchangesets
-    let a:opts.addchangesets={}
-    let addchangesets=a:opts.addchangesets
     "▶3 Initialize variables not required for reading
     if !a:read
         let specials={}
         let a:bvar.rectangles=rectangles
         let a:bvar.specials=specials
         let a:bvar.csstarts=csstarts
+        let 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=!has_key(addchangesets, cs.hex) &&
-                    \(has_key(skipchangesets, cs.hex) ||
-                    \ !s:iterfuncs.check.check(checkd, cs))
+        let skip=!s:iterfuncs.check.check(checkd, cs)
         "▶3 Add cs to skipchangesets or get its properties
         if skip
-            let skipchangesets[cs.hex]=1
+            let a:opts.skipchangesets[cs.hex]=cs
         else
-            let addchangesets[cs.hex]=1
             call map(copy(reqprops),
                         \'a:repo.functions.getcsprop(a:repo, cs, v:val)')
             let foundfirst=1
     let r.expr=join(values(map(filter(copy(a:opts),
                 \                     'has_key(s:keytoexpr, v:key)'),
                 \              'eval(s:keytoexpr[v:key])')), '||')
-    let r.haslimit=(has_key(a:opts, 'limit') && a:opts.limit)
-    if r.haslimit
-        let r.limit=a:opts.limit
-    endif
     "▲3
     return r
 endfunction
 "▶2 iterfuncs.check.check
 function s:iterfuncs.check.check(d, cs)
     "▶3 Check simple cases
-    if (!empty(a:d.expr) && eval(a:d.expr)) || (a:d.haslimit && !a:d.limit)
+    if !empty(a:d.expr) && eval(a:d.expr)
         return 0
     endif
     "▶3 Check files
             return 0
         endif
     endif
-    "▶3 Decrement limit
-    " XXX It is duplicating glog.graphlog functionality
-    if a:d.haslimit
-        let a:d.limit-=1
-    endif
     "▲3
     return 1
 endfunction

File test/git.ok

Binary file modified.

File test/logmaps.ok

 {{{1 <CR>
 aurum://diff:%ETMPDIR%%-test%-logmapsrepo:504f74154456dbb0e9441326514e42ce66279e62:
 {{{1 branch <CR>
-aurum://log:%ETMPDIR%%-test%-logmapsrepo:branch:A,crrestrict:branch,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:branch,branch:A,
 {{{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:branch:A,crrestrict:branch,
+aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:branch,branch:A,
 {{{1 gr
 aurum://log:%ETMPDIR%%-test%-logmapsrepo:crrestrict:revision,revision:be92227e3e43f4e7402408afe110098d209d2568,
 {{{1 gd