Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15
STALE3714d

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v1 [diff vs current]

[PATCH 2/2] Look for a commit's parents in the standard way.

From: Yann Dirson <hidden>
Date: 2016-06-15 22:42:37
Subsystem: the rest · Maintainer: Linus Torvalds

This has the direct effect of taking info/grafts into account, since
ignoring it only causes confusion.

My original implementation was pasted from the same fix applied to
cogito some time ago.  That one is hopefully more pythonic, but it
looks like split() is deprecated for some reason, and I don't know
what should be used instead.

Signed-off-by: Yann Dirson <redacted>
---

 stgit/git.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index c8b7b8f..68b547c 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite
 """
 
 import sys, os, popen2, re, gitmergeonefile
+from string import split
 
 from stgit import basedir
 from stgit.utils import *
@@ -47,12 +48,13 @@ class Commit:
             field = line.strip().split(' ', 1)
             if field[0] == 'tree':
                 self.__tree = field[1]
-            elif field[0] == 'parent':
-                self.__parents.append(field[1])
-            if field[0] == 'author':
+            #elif field[0] == 'parent':
+                #self.__parents.append(field[1])
+            elif field[0] == 'author':
                 self.__author = field[1]
-            if field[0] == 'committer':
+            elif field[0] == 'committer':
                 self.__committer = field[1]
+        self.__parents = split(_output_lines('git-rev-list --parents --max-count=1 %s' % id_hash)[0])[1:]
         self.__log = ''.join(lines[i+1:])
 
     def get_id_hash(self):
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help