|
|
@ -374,7 +374,7 @@ void free_commit_list(struct commit_list *list) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list) |
|
|
|
struct commit_list * commit_list_insert_by_date(struct commit *item, struct commit_list **list) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct commit_list **pp = list; |
|
|
|
struct commit_list **pp = list; |
|
|
|
struct commit_list *p; |
|
|
|
struct commit_list *p; |
|
|
@ -388,11 +388,11 @@ struct commit_list * insert_by_date(struct commit *item, struct commit_list **li |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sort_by_date(struct commit_list **list) |
|
|
|
void commit_list_sort_by_date(struct commit_list **list) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct commit_list *ret = NULL; |
|
|
|
struct commit_list *ret = NULL; |
|
|
|
while (*list) { |
|
|
|
while (*list) { |
|
|
|
insert_by_date((*list)->item, &ret); |
|
|
|
commit_list_insert_by_date((*list)->item, &ret); |
|
|
|
*list = (*list)->next; |
|
|
|
*list = (*list)->next; |
|
|
|
} |
|
|
|
} |
|
|
|
*list = ret; |
|
|
|
*list = ret; |
|
|
@ -412,7 +412,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list, |
|
|
|
struct commit *commit = parents->item; |
|
|
|
struct commit *commit = parents->item; |
|
|
|
if (!parse_commit(commit) && !(commit->object.flags & mark)) { |
|
|
|
if (!parse_commit(commit) && !(commit->object.flags & mark)) { |
|
|
|
commit->object.flags |= mark; |
|
|
|
commit->object.flags |= mark; |
|
|
|
insert_by_date(commit, list); |
|
|
|
commit_list_insert_by_date(commit, list); |
|
|
|
} |
|
|
|
} |
|
|
|
parents = parents->next; |
|
|
|
parents = parents->next; |
|
|
|
} |
|
|
|
} |
|
|
@ -501,7 +501,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo) |
|
|
|
|
|
|
|
|
|
|
|
/* process the list in topological order */ |
|
|
|
/* process the list in topological order */ |
|
|
|
if (!lifo) |
|
|
|
if (!lifo) |
|
|
|
sort_by_date(&work); |
|
|
|
commit_list_sort_by_date(&work); |
|
|
|
|
|
|
|
|
|
|
|
pptr = list; |
|
|
|
pptr = list; |
|
|
|
*list = NULL; |
|
|
|
*list = NULL; |
|
|
@ -527,7 +527,7 @@ void sort_in_topological_order(struct commit_list ** list, int lifo) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (--parent->indegree == 1) { |
|
|
|
if (--parent->indegree == 1) { |
|
|
|
if (!lifo) |
|
|
|
if (!lifo) |
|
|
|
insert_by_date(parent, &work); |
|
|
|
commit_list_insert_by_date(parent, &work); |
|
|
|
else |
|
|
|
else |
|
|
|
commit_list_insert(parent, &work); |
|
|
|
commit_list_insert(parent, &work); |
|
|
|
} |
|
|
|
} |
|
|
@ -587,10 +587,10 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
one->object.flags |= PARENT1; |
|
|
|
one->object.flags |= PARENT1; |
|
|
|
insert_by_date(one, &list); |
|
|
|
commit_list_insert_by_date(one, &list); |
|
|
|
for (i = 0; i < n; i++) { |
|
|
|
for (i = 0; i < n; i++) { |
|
|
|
twos[i]->object.flags |= PARENT2; |
|
|
|
twos[i]->object.flags |= PARENT2; |
|
|
|
insert_by_date(twos[i], &list); |
|
|
|
commit_list_insert_by_date(twos[i], &list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
while (interesting(list)) { |
|
|
|
while (interesting(list)) { |
|
|
@ -608,7 +608,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co |
|
|
|
if (flags == (PARENT1 | PARENT2)) { |
|
|
|
if (flags == (PARENT1 | PARENT2)) { |
|
|
|
if (!(commit->object.flags & RESULT)) { |
|
|
|
if (!(commit->object.flags & RESULT)) { |
|
|
|
commit->object.flags |= RESULT; |
|
|
|
commit->object.flags |= RESULT; |
|
|
|
insert_by_date(commit, &result); |
|
|
|
commit_list_insert_by_date(commit, &result); |
|
|
|
} |
|
|
|
} |
|
|
|
/* Mark parents of a found merge stale */ |
|
|
|
/* Mark parents of a found merge stale */ |
|
|
|
flags |= STALE; |
|
|
|
flags |= STALE; |
|
|
@ -622,7 +622,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co |
|
|
|
if (parse_commit(p)) |
|
|
|
if (parse_commit(p)) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
p->object.flags |= flags; |
|
|
|
p->object.flags |= flags; |
|
|
|
insert_by_date(p, &list); |
|
|
|
commit_list_insert_by_date(p, &list); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -632,7 +632,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co |
|
|
|
while (list) { |
|
|
|
while (list) { |
|
|
|
struct commit_list *next = list->next; |
|
|
|
struct commit_list *next = list->next; |
|
|
|
if (!(list->item->object.flags & STALE)) |
|
|
|
if (!(list->item->object.flags & STALE)) |
|
|
|
insert_by_date(list->item, &result); |
|
|
|
commit_list_insert_by_date(list->item, &result); |
|
|
|
free(list); |
|
|
|
free(list); |
|
|
|
list = next; |
|
|
|
list = next; |
|
|
|
} |
|
|
|
} |
|
|
@ -725,7 +725,7 @@ struct commit_list *get_merge_bases_many(struct commit *one, |
|
|
|
result = NULL; |
|
|
|
result = NULL; |
|
|
|
for (i = 0; i < cnt; i++) { |
|
|
|
for (i = 0; i < cnt; i++) { |
|
|
|
if (rslt[i]) |
|
|
|
if (rslt[i]) |
|
|
|
insert_by_date(rslt[i], &result); |
|
|
|
commit_list_insert_by_date(rslt[i], &result); |
|
|
|
} |
|
|
|
} |
|
|
|
free(rslt); |
|
|
|
free(rslt); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|