get_merge_bases() should return a list rather than set
authorCatalin Marinas <catalin.marinas@gmail.com>
Fri, 22 Oct 2010 15:44:12 +0000 (16:44 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 22 Oct 2010 15:44:12 +0000 (16:44 +0100)
This is for cases where we need to use one of the elements of the list.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/publish.py
stgit/lib/git.py

index 3aa83a2..6bd1c94 100644 (file)
@@ -155,7 +155,7 @@ def func(parser, options, args):
 
     # check for rebased stack. In this case we emulate a merge with the stack
     # base by setting two parents.
-    merge_bases = repository.get_merge_bases(public_head, stack.base)
+    merge_bases = set(repository.get_merge_bases(public_head, stack.base))
     if public_head in merge_bases:
         # fast-forward the public ref
         repository.refs.set(public_ref, stack.head, 'publish')
index d60e1d2..3378728 100644 (file)
@@ -653,7 +653,7 @@ class Repository(RunWithEnv):
         """Return a set of merge bases of two commits."""
         sha1_list = self.run(['git', 'merge-base', '--all',
                               commit1.sha1, commit2.sha1]).output_lines()
-        return set(self.get_commit(sha1) for sha1 in sha1_list)
+        return [self.get_commit(sha1) for sha1 in sha1_list]
     def describe(self, commit):
         """Use git describe --all on the given commit."""
         return self.run(['git', 'describe', '--all', commit.sha1]