Track the files conflict history
[stgit] / stgit / stack.py
index e650713..2ae4dd5 100644 (file)
@@ -933,7 +933,7 @@ class Series(StgitObject):
 
                 # merge can fail but the patch needs to be pushed
                 try:
-                    git.merge(bottom, head, top)
+                    git.merge(bottom, head, top, recursive = True)
                 except git.GitException, ex:
                     print >> sys.stderr, \
                           'The merge failed during "push". ' \
@@ -959,6 +959,11 @@ class Series(StgitObject):
                     log = 'push'
                 self.refresh_patch(cache_update = False, log = log)
             else:
+                # we store the correctly merged files only for
+                # tracking the conflict history. Note that the
+                # git.merge() operations shouls always leave the index
+                # in a valid state (i.e. only stage 0 files)
+                self.refresh_patch(cache_update = False, log = 'push(c)')
                 raise StackException, str(ex)
 
         return modified