- else:
- # new patch needs to be refreshed.
- # The current patch is empty after merge.
- patch.set_bottom(head, backup = True)
- patch.set_top(head, backup = True)
-
- # Try the fast applying first. If this fails, fall back to the
- # three-way merge
- if not git.apply_diff(bottom, top):
- # if git.apply_diff() fails, the patch requires a diff3
- # merge and can be reported as modified
- modified = True
-
- # merge can fail but the patch needs to be pushed
- try:
- git.merge(bottom, head, top, recursive = True)
- except git.GitException, ex:
- out.error('The merge failed during "push".',
- 'Use "refresh" after fixing the conflicts or'
- ' revert the operation with "push --undo".')
+ append_string(self.__applied_file, name)
+
+ unapplied.remove(name)
+ write_strings(self.__unapplied_file, unapplied)
+ return False
+
+ # Need to create a new commit an merge in the old patch
+ ex = None
+ modified = False
+
+ # new patch needs to be refreshed.
+ # The current patch is empty after merge.
+ patch.set_bottom(head, backup = True)
+ patch.set_top(head, backup = True)
+
+ # Try the fast applying first. If this fails, fall back to the
+ # three-way merge
+ if not git.apply_diff(bottom, top):
+ # if git.apply_diff() fails, the patch requires a diff3
+ # merge and can be reported as modified
+ modified = True
+
+ # merge can fail but the patch needs to be pushed
+ try:
+ git.merge(bottom, head, top, recursive = True)
+ except git.GitException, ex:
+ out.error('The merge failed during "push".',
+ 'Use "refresh" after fixing the conflicts or'
+ ' revert the operation with "push --undo".')