summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1dcb3be)
raw | patch | inline | side by side (parent: 1dcb3be)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 12 Sep 2006 08:17:46 +0000 (10:17 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Tue, 12 Sep 2006 08:17:46 +0000 (10:17 +0200) |
tig.c | patch | blob | history |
index 2431f66e56df34624c43345214f014a9a14082a4..766b973c0bcbbb3dd9873eab2fb39a7f19a14d86 100644 (file)
--- a/tig.c
+++ b/tig.c
{
struct rev_stack *stack = &graph_stacks[graph_stack_no++ & 1];
struct rev_stack *graph = &graph_stacks[graph_stack_no & 1];
- chtype symbol;
+ static chtype last_symbol;
+ chtype symbol, separator, line;
size_t stackpos = 0;
size_t i;
/* First traverse all lines of revisions up to the active one. */
for (stackpos = 0; stackpos < stack->size; stackpos++) {
if (!strcmp(stack->rev[stackpos], commit->id)) {
- while (stackpos + 1 < stack->size &&
- !strcmp(stack->rev[stackpos + 1], commit->id))
- stackpos++;
break;
}
push_rev_stack(graph, stack->rev[stackpos]);
- commit->graph[commit->graph_size++] = ACS_VLINE;
- commit->graph[commit->graph_size++] = ' ';
}
assert(commit->graph_size < ARRAY_SIZE(commit->graph));
else
symbol = '*';
+ i = stackpos + 1;
+
+ /* FIXME: Moving branches left and right when collapsing a branch. */
+ while (i < stack->size)
+ push_rev_stack(graph, stack->rev[i++]);
+
+ separator = ' ';
+ line = ACS_VLINE;
+
+ for (i = 0; i < stackpos; i++) {
+ commit->graph[commit->graph_size++] = line;
+ if (last_symbol == 'M') {
+ separator = '`';
+ line = '.';
+ }
+ commit->graph[commit->graph_size++] = separator;
+ }
+
commit->graph[commit->graph_size++] = symbol;
- stackpos++;
+ separator = ' ';
+ line = ACS_VLINE;
+ if (last_symbol == 'M') {
+ line = ' ';
+ }
- /* FIXME: Moving branches left and right when collapsing a branch. */
- while (stackpos < stack->size) {
- push_rev_stack(graph, stack->rev[stackpos++]);
- commit->graph[commit->graph_size++] = ' ';
- commit->graph[commit->graph_size++] = ACS_VLINE;
+ for (i += 1; i < stack->size; i++) {
+ commit->graph[commit->graph_size++] = separator;
+ commit->graph[commit->graph_size++] = line;
+ if (last_symbol == 'M') {
+ separator = '`';
+ line = '.';
+ }
}
+ last_symbol = symbol;
stack->size = graph_parents.size = 0;
}