From c231551328faa864848bde6ff8127f59c9566e90 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 2 Sep 2008 22:05:44 -0700 Subject: commit: handle --bisect-all output in Commit.list_from_string Rui Abreu Ferrerira pointed out that "git rev-list --bisect-all" returns a slightly different format which we can easily accomodate by changing the way we parse rev-list output. http://groups.google.com/group/git-python/browse_thread/thread/aed1d5c4b31d5027 This resolves the issue mentioned in that thread. Signed-off-by: David Aguilar --- lib/git/commit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/git/commit.py') diff --git a/lib/git/commit.py b/lib/git/commit.py index 2835e07f..d30d1250 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -139,17 +139,17 @@ class Commit(LazyMixin): commits = [] while lines: - id = lines.pop(0).split()[-1] - tree = lines.pop(0).split()[-1] + id = lines.pop(0).split()[1] + tree = lines.pop(0).split()[1] parents = [] - while lines and re.search(r'^parent', lines[0]): + while lines and lines[0].startswith('parent'): parents.append(lines.pop(0).split()[-1]) author, authored_date = cls.actor(lines.pop(0)) committer, committed_date = cls.actor(lines.pop(0)) messages = [] - while lines and re.search(r'^ {4}', lines[0]): + while lines and lines[0].startswith(' '): messages.append(lines.pop(0).strip()) message = messages and messages[0] or '' -- cgit v1.2.1