ZyX_I avatar ZyX_I committed ef1fe47

@aurum/log: Fixed a difference between this implementation of hg grapher and original

Comments (0)

Files changed (3)

plugin/aurum/log.vim

 "▶2 glog.get_nodeline_edges_tail
 function s:F.glog.get_nodeline_edges_tail(node_index, p_node_index, n_columns,
             \                             n_columns_diff, p_diff, fix_tail)
-    if a:fix_tail && a:n_columns_diff==a:p_diff && a:n_columns_diff!=0
+    if a:fix_tail && a:n_columns_diff && a:n_columns_diff==a:p_diff
         if a:n_columns_diff==-1
             let start=max([a:node_index+1, a:p_node_index])
             return repeat(['|', ' '], (start-a:node_index-1))+
     if coldiff==-1
         call s:F.glog.fix_long_right_edges(edges)
         if lnum>2
-            let add_padding_line=!empty(map(filter(copy(edges),
-                        \                          '(v:val[0]+1)<v:val[1]'),
-                        \                   'v:val[0]'))
+            let add_padding_line=!empty(filter(copy(edges),
+                        \                      '(v:val[0]+1)<v:val[1]'))
         endif
     endif
-    let fix_nodeline_tail = (lnum<=2 && add_padding_line)
+    let fix_nodeline_tail = (lnum<=2 && !add_padding_line)
     let shift_interline=repeat(['|', ' '], idx)
     let nodeline=shift_interline+[a:char, ' ']+
                 \s:F.glog.get_nodeline_edges_tail(idx,     a:state[1], ncols,
                 \                                 coldiff, a:state[0],
                 \                                 fix_nodeline_tail)
     let n_spaces=(1+((coldiff==-1)?(0):(1+(coldiff!=0))))
-    let edge_ch='/|\'[n_spaces-1]
-    let shift_interline+=repeat([' '], n_spaces)+
-                \        repeat([edge_ch, ' '], (ncols-idx-1))
+    let shift_interline+=repeat([' '],                    n_spaces)+
+                \        repeat(['/|\'[n_spaces-1], ' '], ncols-idx-1)
     call s:F.glog.draw_edges(edges, nodeline, shift_interline)
     let joined_nl=join(nodeline, '')
     let joined_sil=join(shift_interline, '')

test/cmd-log-templates.ok

 |  
 o    -
 |\   
-o |    -
+o \    -
 |\ \   
 | | o    -
 | | |\   
-| | o |    -
+| | o \    -
 | | |\ \   
 | | | | | o  -
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  
 | | | | |/   
 |  
 o    e5648a3eea574f3fc03709b4fdd799a38f649edd
 |\   
-o |    462a1e95be86f96aaf6d7360f6f770826c3eb641
+o \    462a1e95be86f96aaf6d7360f6f770826c3eb641
 |\ \   
 | | o    be92227e3e43f4e7402408afe110098d209d2568
 | | |\   
-| | o |    5e2f73d0c01dfb8ee0d3577e03d016a5f6df58b1
+| | o \    5e2f73d0c01dfb8ee0d3577e03d016a5f6df58b1
 | | |\ \   
 | | | | | o  14b19ea42f824c8597f8358149c5ba994299a410
 | | | | |/   
 |  
 o    17
 |\   
-o |    16
+o \    16
 |\ \   
 | | o    15
 | | |\   
-| | o |    14
+| | o \    14
 | | |\ \   
 | | | | | o  13
 | | | | |/   
 |  
 o    C <c@example.gov>
 |\   
-o |    C <c@example.gov>
+o \    C <c@example.gov>
 |\ \   
 | | o    C <c@example.gov>
 | | |\   
-| | o |    C <c@example.gov>
+| | o \    C <c@example.gov>
 | | |\ \   
 | | | | | o  B <b@example.org>
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    A
 | | |\   
-| | o |    A
+| | o \    A
 | | |\ \   
 | | | | | o  C
 | | | | |/   
 |  
 o    17[default]
 |\   
-o |    16[default]
+o \    16[default]
 |\ \   
 | | o    15[A]
 | | |\   
-| | o |    14[A]
+| | o \    14[A]
 | | |\ \   
 | | | | | o  13[C]
 | | | | |/   
 |  
 o    17[]
 |\   
-o |    16[]
+o \    16[]
 |\ \   
 | | o    15[A]
 | | |\   
-| | o |    14[A]
+| | o \    14[A]
 | | |\ \   
 | | | | | o  13[C]
 | | | | |/   
 |  
 o    17
 |\   
-o |    16
+o \    16
 |\ \   
 | | o    15[A]
 | | |\   
-| | o |    14[A]
+| | o \    14[A]
 | | |\ \   
 | | | | | o  13[C]
 | | | | |/   
 |  
 o    17
 |\   
-o |    16
+o \    16
 |\ \   
 | | o    15/A
 | | |\   
-| | o |    14/A
+| | o \    14/A
 | | |\ \   
 | | | | | o  13/C
 | | | | |/   
 |  
 o    17 
 |\   
-o |    16 
+o \    16 
 |\ \   
 | | o    15 A!
 | | |\   
-| | o |    14 A!
+| | o \    14 A!
 | | |\ \   
 | | | | | o  13 C!
 | | | | |/   
 |  
 o    01 Янв 2002 00:00
 |\   
-o |    01 Янв 2002 00:00
+o \    01 Янв 2002 00:00
 |\ \   
 | | o    01 Янв 2002 00:00
 | | |\   
-| | o |    01 Янв 2002 00:00
+| | o \    01 Янв 2002 00:00
 | | |\ \   
 | | | | | o  01 Фев 2001 14:56
 | | | | |/   
 |  
 o    2002 001
 |\   
-o |    2002 001
+o \    2002 001
 |\ \   
 | | o    2002 001
 | | |\   
-| | o |    2002 001
+| | o \    2002 001
 | | |\ \   
 | | | | | o  2001 032
 | | | | |/   
 |  
 o    462a1e95be86f96aaf6d7360f6f770826c3eb641 be92227e3e43f4e7402408afe110098d209d2568
 |\   
-o |    269399222040415b3928a316f5d28792cc0be4dd c4110a066208167dae46b08f4e0d8d2b37e842f3
+o \    269399222040415b3928a316f5d28792cc0be4dd c4110a066208167dae46b08f4e0d8d2b37e842f3
 |\ \   
 | | o    5e2f73d0c01dfb8ee0d3577e03d016a5f6df58b1 023aa55bd8062179ce36adbdd78363e9b88718c1
 | | |\   
-| | o |    d760b0fe4fe45adf585f5030181b8081899e26a9 9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe
+| | o \    d760b0fe4fe45adf585f5030181b8081899e26a9 9fe0c28c3e1dd175e8372b742f13cbb7bd6799fe
 | | |\ \   
 | | | | | o  023aa55bd8062179ce36adbdd78363e9b88718c1
 | | | | |/   
 |  
 o    f44a21859e57e4abc6155da804d08dd5069e798e
 |\   
-o |    e5648a3eea574f3fc03709b4fdd799a38f649edd
+o \    e5648a3eea574f3fc03709b4fdd799a38f649edd
 |\ \   
 | | o    e5648a3eea574f3fc03709b4fdd799a38f649edd
 | | |\   
-| | o |    be92227e3e43f4e7402408afe110098d209d2568
+| | o \    be92227e3e43f4e7402408afe110098d209d2568
 | | |\ \   
 | | | | | o  
 | | | | |/   
 |  
 o    ;
 |\   
-o |    ;
+o \    ;
 |\ \   
 | | o    ;
 | | |\   
-| | o |    ;
+| | o \    ;
 | | |\ \   
 | | | | | o  ;
 | | | | |/   
 |  
 o    ;
 |\   
-o |    ;
+o \    ;
 |\ \   
 | | o    ;
 | | |\   
-| | o |    ;
+| | o \    ;
 | | |\ \   
 | | | | | o  ;
 | | | | |/   
 |  
 o    17
 |\   
-o |    16
+o \    16
 |\ \   
 | | o    15
 | | |\   
-| | o |    14
+| | o \    14
 | | |\ \   
 | | | | | o  13
 | | | | |/   
 |  
 o    Merge from A
 |\   
-o |    Merge from C:1
+o \    Merge from C:1
 |\ \   
 | | o    Merge from C:2
 | | |\   
-| | o |    Merge from B
+| | o \    Merge from B
 | | |\ \   
 | | | | | o  Added tag clines for changeset 023aa55bd806
 | | | | |/   
 |  
 o    17: Merge from A-
 |\   
-o |    16: Merge from C:1-
+o \    16: Merge from C:1-
 |\ \   
 | | o    15: Merge from C:2-
 | | |\   
-| | o |    14: Merge from B-
+| | o \    14: Merge from B-
 | | |\ \   
 | | | | | o  13: Added tag clines for changeset 023aa55bd806-
 | | | | |/   
 | | | |  15:   blines.lst  | 16 0
 | | | |  15:   clines.lst  | 49 0
 | | | |  15: 4 files changed, 79 insertions, 0 deletions
-| | o |    14:   alines.lst | 64 0
+| | o \    14:   alines.lst | 64 0
 | | |\ \   14: 1 files changed, 64 insertions, 0 deletions
 | | | | | o  13:   .hgtags | 1 0
 | | | | |/   13: 1 files changed, 1 insertions, 0 deletions
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  .hgtags
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  .hgtags
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  .hgtags
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  .hgtags
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  
 | | | | |/   
 |  
 o    
 |\   
-o |    
+o \    
 |\ \   
 | | o    
 | | |\   
-| | o |    
+| | o \    
 | | |\ \   
 | | | | | o  
 | | | | |/   
 | +-----* 
 | +-----* 
 |\ \ \ \ 
+| | * / / 
 | |/ / / 
 | *---+ 
 |  / / 
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.