Show More
@@ -225,8 +225,7 b' def graphlog(ui, repo, path=None, **opts' | |||||
225 | prev_node_index = 0 |
|
225 | prev_node_index = 0 | |
226 |
|
226 | |||
227 | for (rev, node, node_index, edges, n_columns, n_columns_diff) in grapher: |
|
227 | for (rev, node, node_index, edges, n_columns, n_columns_diff) in grapher: | |
228 | # log_strings is the list of all log strings to draw alongside |
|
228 | # log_strings is the list of all log strings to draw alongside the graph | |
229 | # the graph. |
|
|||
230 | ui.pushbuffer() |
|
229 | ui.pushbuffer() | |
231 | cs_printer.show(rev, node) |
|
230 | cs_printer.show(rev, node) | |
232 | log_strings = ui.popbuffer().split("\n")[:-1] |
|
231 | log_strings = ui.popbuffer().split("\n")[:-1] | |
@@ -260,7 +259,7 b' def graphlog(ui, repo, path=None, **opts' | |||||
260 | # o | | o | | |
|
259 | # o | | o | | | |
261 | fix_nodeline_tail = len(log_strings) <= 2 and not add_padding_line |
|
260 | fix_nodeline_tail = len(log_strings) <= 2 and not add_padding_line | |
262 |
|
261 | |||
263 |
# nodeline is the line containing the node character ( |
|
262 | # nodeline is the line containing the node character (typically o) | |
264 | nodeline = ["|", " "] * node_index |
|
263 | nodeline = ["|", " "] * node_index | |
265 | if node in repo_parents: |
|
264 | if node in repo_parents: | |
266 | node_ch = "@" |
|
265 | node_ch = "@" | |
@@ -274,7 +273,7 b' def graphlog(ui, repo, path=None, **opts' | |||||
274 | prev_n_columns_diff, fix_nodeline_tail)) |
|
273 | prev_n_columns_diff, fix_nodeline_tail)) | |
275 |
|
274 | |||
276 | # shift_interline is the line containing the non-vertical |
|
275 | # shift_interline is the line containing the non-vertical | |
277 |
# edges between this entry and the next |
|
276 | # edges between this entry and the next | |
278 | shift_interline = ["|", " "] * node_index |
|
277 | shift_interline = ["|", " "] * node_index | |
279 | if n_columns_diff == -1: |
|
278 | if n_columns_diff == -1: | |
280 | n_spaces = 1 |
|
279 | n_spaces = 1 | |
@@ -288,17 +287,17 b' def graphlog(ui, repo, path=None, **opts' | |||||
288 | shift_interline.extend(n_spaces * [" "]) |
|
287 | shift_interline.extend(n_spaces * [" "]) | |
289 | shift_interline.extend([edge_ch, " "] * (n_columns - node_index - 1)) |
|
288 | shift_interline.extend([edge_ch, " "] * (n_columns - node_index - 1)) | |
290 |
|
289 | |||
291 |
# |
|
290 | # draw edges from the current node to its parents | |
292 | draw_edges(edges, nodeline, shift_interline) |
|
291 | draw_edges(edges, nodeline, shift_interline) | |
293 |
|
292 | |||
294 |
# lines is the list of all graph lines to print |
|
293 | # lines is the list of all graph lines to print | |
295 | lines = [nodeline] |
|
294 | lines = [nodeline] | |
296 | if add_padding_line: |
|
295 | if add_padding_line: | |
297 | lines.append(get_padding_line(node_index, n_columns, edges)) |
|
296 | lines.append(get_padding_line(node_index, n_columns, edges)) | |
298 | lines.append(shift_interline) |
|
297 | lines.append(shift_interline) | |
299 |
|
298 | |||
300 |
# |
|
299 | # make sure that there are as many graph lines as there are | |
301 |
# log strings |
|
300 | # log strings | |
302 | while len(log_strings) < len(lines): |
|
301 | while len(log_strings) < len(lines): | |
303 | log_strings.append("") |
|
302 | log_strings.append("") | |
304 | if len(lines) < len(log_strings): |
|
303 | if len(lines) < len(log_strings): | |
@@ -306,12 +305,12 b' def graphlog(ui, repo, path=None, **opts' | |||||
306 | while len(lines) < len(log_strings): |
|
305 | while len(lines) < len(log_strings): | |
307 | lines.append(extra_interline) |
|
306 | lines.append(extra_interline) | |
308 |
|
307 | |||
309 |
# |
|
308 | # print lines | |
310 | indentation_level = max(n_columns, n_columns + n_columns_diff) |
|
309 | indentation_level = max(n_columns, n_columns + n_columns_diff) | |
311 | for (line, logstr) in zip(lines, log_strings): |
|
310 | for (line, logstr) in zip(lines, log_strings): | |
312 | ui.write(format_line(line, indentation_level, logstr)) |
|
311 | ui.write(format_line(line, indentation_level, logstr)) | |
313 |
|
312 | |||
314 |
# ...and start over |
|
313 | # ... and start over | |
315 | prev_node_index = node_index |
|
314 | prev_node_index = node_index | |
316 | prev_n_columns_diff = n_columns_diff |
|
315 | prev_n_columns_diff = n_columns_diff | |
317 |
|
316 |
General Comments 0
You need to be logged in to leave comments.
Login now