Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1097)

Unified Diff: git_rebase_update.py

Issue 667793005: Handle unusual case in rebase-update where second attempt works. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_auto_svn.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_rebase_update.py
diff --git a/git_rebase_update.py b/git_rebase_update.py
index 53e0287dd4663423a7ab8897df27e6aaa19910b0..a61e53a3ab5b5b94e482e0eef9e71fd82ad9f2c6 100755
--- a/git_rebase_update.py
+++ b/git_rebase_update.py
@@ -148,30 +148,36 @@ def rebase_branch(branch, parent, start_hash):
git.squash_current_branch(merge_base=start_hash)
git.rebase(parent, start_hash, branch)
else:
+ print "Failed!"
+ print
+
# rebase and leave in mid-rebase state.
# This second rebase attempt should always fail in the same
# way that the first one does. If it magically succeeds then
# something very strange has happened.
second_rebase_ret = git.rebase(parent, start_hash, branch)
- assert(not second_rebase_ret.success)
- print "Failed!"
- print
- print "Here's what git-rebase (squashed) had to say:"
- print
- print squash_ret.stdout
- print squash_ret.stderr
- print textwrap.dedent(
- """\
- Squashing failed. You probably have a real merge conflict.
-
- Your working copy is in mid-rebase. Either:
- * completely resolve like a normal git-rebase; OR
- * abort the rebase and mark this branch as dormant:
- git config branch.%s.dormant true
-
- And then run `git rebase-update` again to resume.
- """ % branch)
- return False
+ if second_rebase_ret.success: # pragma: no cover
+ print "Second rebase succeeded unexpectedly!"
+ print "Please see: http://crbug.com/425696"
+ print "First rebased failed with:"
+ print rebase_ret.stderr
+ else:
+ print "Here's what git-rebase (squashed) had to say:"
+ print
+ print squash_ret.stdout
+ print squash_ret.stderr
+ print textwrap.dedent(
+ """\
+ Squashing failed. You probably have a real merge conflict.
+
+ Your working copy is in mid-rebase. Either:
+ * completely resolve like a normal git-rebase; OR
+ * abort the rebase and mark this branch as dormant:
+ git config branch.%s.dormant true
+
+ And then run `git rebase-update` again to resume.
+ """ % branch)
+ return False
else:
print '%s up-to-date' % branch
« no previous file with comments | « git_auto_svn.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698