Commits

ZyX_I  committed 642923e

@aurum/repo: This looks cleaner. Ref #8

  • Participants
  • Parent commits c7634bf
  • Branches validancestors

Comments (0)

Files changed (1)

File plugin/aurum/repo.vim

     endfor
     return {'addrevs': [cs], 'revisions': {}, 'repo': a:repo,
                 \'hasrevisions': get(a:repo, 'hasrevisions', 1),
-                \'indegree': indegree}
+                \'indegree': indegree, 'incremented': {cs.hex : 1}}
 endfunction
 function! s:RevCmp(cs1, cs2)
     let rev1=a:cs1.rev
         endif
     endfor
     call remove(a:d.addrevs, i)
-    unsilent echom a:d.indegree[cs.hex] cs.hex
-    if has_key(a:d.revisions, cs.hex)
-        return s:iterfuncs.ancestors.next(a:d)
-    endif
     let a:d.revisions[cs.hex]=cs
     for parenthex in filter(copy(cs.parents), '!has_key(a:d.revisions, v:val)')
         let parent=a:d.repo.functions.getcs(a:d.repo, parenthex)
         let a:d.indegree[parenthex]=a:d.indegree[parenthex]-1
-        for pparhex in parent.parents
-            let a:d.indegree[pparhex]=get(a:d.indegree, pparhex, 1)+1
-        endfor
-        let a:d.addrevs+=[parent]
+        if !has_key(a:d.incremented, parenthex)
+            let a:d.incremented[parenthex]=1
+            for pparhex in parent.parents
+                let a:d.indegree[pparhex]=get(a:d.indegree, pparhex, 1)+1
+            endfor
+            let a:d.addrevs+=[parent]
+        endif
     endfor
-    " if a:d.hasrevisions
-        " call sort(a:d.addrevs, 's:RevCmp')
-    " endif
     return cs
 endfunction
 "▶2 revrange