Fix typo: comitter->committer
[stgit] / stgit / git.py
index e4aacd5..20c84c8 100644 (file)
@@ -45,6 +45,7 @@ class Commit:
         self.__id_hash = id_hash
 
         lines = _output_lines('git-cat-file commit %s' % id_hash)
+        self.__parents = []
         for i in range(len(lines)):
             line = lines[i]
             if line == '\n':
@@ -53,10 +54,10 @@ class Commit:
             if field[0] == 'tree':
                 self.__tree = field[1]
             elif field[0] == 'parent':
-                self.__parent = field[1]
+                self.__parents.append(field[1])
             if field[0] == 'author':
                 self.__author = field[1]
-            if field[0] == 'comitter':
+            if field[0] == 'committer':
                 self.__committer = field[1]
         self.__log = ''.join(lines[i:])
 
@@ -67,7 +68,10 @@ class Commit:
         return self.__tree
 
     def get_parent(self):
-        return self.__parent
+        return self.__parents[0]
+
+    def get_parents(self):
+        return self.__parents
 
     def get_author(self):
         return self.__author
@@ -75,6 +79,9 @@ class Commit:
     def get_committer(self):
         return self.__committer
 
+    def get_log(self):
+        return self.__log
+
 # dictionary of Commit objects, used to avoid multiple calls to git
 __commits = dict()
 
@@ -346,7 +353,7 @@ def merge(base, head1, head2):
         raise GitException, 'git-read-tree failed (local changes maybe?)'
 
     # this can fail if there are conflicts
-    if os.system('git-merge-cache -o gitmergeonefile.py -a') != 0:
+    if os.system('git-merge-cache -o -q gitmergeonefile.py -a') != 0:
         raise GitException, 'git-merge-cache failed (possible conflicts)'
 
 def status(files = [], modified = False, new = False, deleted = False,