summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2dea5a)
raw | patch | inline | side by side (parent: c2dea5a)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 6 Mar 2007 02:23:57 +0000 (18:23 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 6 Mar 2007 09:08:34 +0000 (01:08 -0800) |
This moves the code to set SHOWN on the commit from get_revision_1()
back to get_revision(), so that the bit means what it originally
meant: this commit has been given back to the caller.
Also it fixes the --reverse breakage Dscho pointed out.
Signed-off-by: Junio C Hamano <junkio@cox.net>
back to get_revision(), so that the bit means what it originally
meant: this commit has been given back to the caller.
Also it fixes the --reverse breakage Dscho pointed out.
Signed-off-by: Junio C Hamano <junkio@cox.net>
revision.c | patch | blob | history |
diff --git a/revision.c b/revision.c
index 2d27ccf70b046b1928aa725d531ff354f0674f0a..35a171105a28ce10fdef58c46efdd73cd113dd50 100644 (file)
--- a/revision.c
+++ b/revision.c
if (revs->parents)
rewrite_parents(revs, commit);
}
- commit->object.flags |= SHOWN;
return commit;
} while (revs->commits);
return NULL;
}
if (revs->reverse) {
+ int limit = -1;
+
+ if (0 <= revs->max_count) {
+ limit = revs->max_count;
+ if (0 < revs->skip_count)
+ limit += revs->skip_count;
+ }
l = NULL;
- while ((c = get_revision_1(revs)))
+ while ((c = get_revision_1(revs))) {
commit_list_insert(c, &l);
+ if ((0 < limit) && !--limit)
+ break;
+ }
revs->commits = l;
revs->reverse = 0;
+ revs->max_count = -1;
c = NULL;
}
c = get_revision_1(revs);
if (!c)
break;
- /* Although we grabbed it, it is not shown. */
- c->object.flags &= ~SHOWN;
}
/*
break;
case 0:
/* Although we grabbed it, it is not shown. */
- if (c)
- c->object.flags &= ~SHOWN;
c = NULL;
break;
default:
revs->max_count--;
}
- if (!revs->boundary)
+ if (c)
+ c->object.flags |= SHOWN;
+
+ if (!revs->boundary) {
return c;
+ }
if (!c) {
/*
for (l = c->parents; l; l = l->next) {
struct object *p;
p = &(l->item->object);
- if (p->flags & CHILD_SHOWN)
+ if (p->flags & (CHILD_SHOWN | SHOWN))
continue;
p->flags |= CHILD_SHOWN;
gc_boundary(&revs->boundary_commits);