ZyX_I avatar ZyX_I committed 4aa0ea9

@aurum/log: Made git grapher also draw skipped changesets
Fixes #9 : no need to know which parents are interesting in this case

Comments (0)

Files changed (3)

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)')
+    let self.interesting_parents=copy(a:cs.parents)
     let self.num_parents=len(self.interesting_parents)
     let self.prev_commit_index=self.commit_index
     call self.update_columns()
 endfunction
 "▶2 graph.output_commit_char :: graph → String
 function s:F.graph.output_commit_char()
+    if has_key(self.skipchangesets, self.cs.hex)
+        return '*'
+    endif
     return '@o'[index(self.workcss, self.cs.hex)==-1]
 endfunction
 "▶2 graph.draw_octopus_merge :: graph → String
     endif
     if has_key(a:text, 'skip')
         let joined_sil=join(shift_interline, '')
-        let joined_nl=substitute(join(nodeline, ''), '\V'.a:char, '|', '')
+        let joined_nl=join(nodeline, '')
         let a:text.text=[]
-        if joined_nl!~#'\v^[o| ]+$'
-            let a:text.text+=[substitute(joined_nl,'\v\-@<=\||\|\-@=','+','')]
+        if joined_nl!~#'\v^[*| ]+$'
+            let a:text.text+=[joined_nl]
         endif
-        if joined_sil!~#'\v^[| ]+$' && joined_sil isnot# joined_nl
+        if joined_sil!~#'\v^[| ]+$' &&
+                    \joined_sil isnot# tr(joined_nl, a:char, '|')
             let a:text.text+=[joined_sil]
         endif
         return a:text
     let lines=((a:graph.cs is 0)?([]):(a:graph.show_remainder()))
     call a:graph.update(a:cs)
     let lines+=a:graph.show_commit()
+    let skip=has_key(a:text, 'skip')
+    if skip && len(lines)==1 && lines[0]!~#'[^|* ]'
+        return a:text
+    endif
     let collen=len(lines[-1])
     let a:text.block_r[0][1]+=collen
     let a:text.block_r[1][1]+=collen
 endfunction
 function s:iterfuncs.git.proccs(d, cs)
     if has_key(a:d.opts.skipchangesets, a:cs.hex)
-        return [[], 0, 0]
+        let text={'skip': 1, 'text': [], 'special': {}}
+    else
+        let text=a:d.opts.templatefunc(a:cs, a:d.opts, a:d.repo)
     endif
-    let text=a:d.opts.templatefunc(a:cs, a:d.opts, a:d.repo)
     let text.block_r=[[0, 0],
                 \     [len(text.text)-1,
                 \      max(map(copy(text.text), 'len(v:val)'))]]
                 \'showparents': get(a:000, 0, []), 'repo': a:repo}
 endfunction
 function s:iterfuncs.hg.proccs(d, cs)
-    let char=((index(a:d.showparents, a:cs.hex)==-1)?('o'):('@'))
     if has_key(a:d.opts.skipchangesets, a:cs.hex)
+        let char='*'
         let text={'skip': 1}
         let skip=1
     else
+        let char=((index(a:d.showparents, a:cs.hex)==-1)?('o'):('@'))
         let text=a:d.opts.templatefunc(a:cs, a:d.opts, a:d.repo)
         let skip=0
     endif

Binary file modified.

 | | |/ 
 | | |/ 
 | | | |\ 
-| | +---+ 
+| | *---+ 
 | |  / / 
-| +---+ 
+| +---* 
 |/ / 
 o |  Changeset 5:d760b0fe4fe45adf585f5030181b8081899e26a9 (branch A)
 |/   Commited 01 Ноя 2000 13:24 by B <b@example.org>
 | | | |  
 |\ \ \ \ 
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | |/ 
 |/ 
 | | | | |  @ Merge from B
 | | | | |  
 | | | | |/ 
-| +-----+ 
-| +-----+ 
+| +-----* 
+| +-----* 
 o | | |    Changeset 9:269399222040415b3928a316f5d28792cc0be4dd
 |\ \ \ \   Commited 01 Янв 2001 00:00 by C <c@example.gov>
 | | | | |  @ Merge from C
 | | | | |  
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | |/ 
 |/ 
 | | |\ 
 | | |\ \ 
 | | | | |/ 
-| +-----+ 
+| +-----* 
 | +-----o  Changeset 11:0e6e0adf281b423193f9dce097ab1df4f91215f7 (branch C)
 | | | |    Commited 01 Фев 2001 05:19 by A <a@example.com>
 | | | |    @ Added tag blines for changeset c4110a066208
 | | | |  
 |\ \ \ \ 
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | | o  Changeset 6:9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe (branch B)
 | |/   Commited 02 Ноя 2000 05:44 by A <a@example.com>
 | | |\ 
 | | |\ \ 
 | | | | |/ 
-| +-----+ 
-| +-----+ 
+| +-----* 
+| +-----* 
 |\ \ \ \ 
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | |/ 
 |/ 
 | | | | |  @ Merge from B
 | | | | |  
 | | | | |/ 
-| +-----+ 
-| +-----+ 
+| +-----* 
+| +-----* 
 o | | |    Changeset 9:269399222040415b3928a316f5d28792cc0be4dd
 |\ \ \ \   Commited 01 Янв 2001 00:00 by C <c@example.gov>
 | | | | |  @ Merge from C
 | | | | |  
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | |/ 
 |/ 
 | | |\ 
 | | |\ \ 
 | | | | |/ 
-| +-----+ 
-| +-----+ 
+| +-----* 
+| +-----* 
 |\ \ \ \ 
 | |/ / / 
-| +---+ 
+| *---+ 
 |  / / 
 | |/ 
 |/ 
 | | | | |  @ Merge from B
 | | | | |  
 | | | | |/ 
-| +-----+ 
-| +-----+ 
+| +-----* 
+| +-----* 
 o | | |    Changeset 9:269399222040415b3928a316f5d28792cc0be4dd
 |\ \ \ \   Commited 01 Янв 2001 00:00 by C <c@example.gov>
 | | | | |  @ Merge from C
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.