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

Unified Diff: git_reparent_branch.py

Issue 288323002: Make marked merge base invalid when the upstream changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 7 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
Index: git_reparent_branch.py
diff --git a/git_reparent_branch.py b/git_reparent_branch.py
index 9b7dace27fec9e5210b9227643d0cfe459c8c7b4..f9bf9c5c3e80407e6a3879e448d950ddbf3cd950 100755
--- a/git_reparent_branch.py
+++ b/git_reparent_branch.py
@@ -11,7 +11,7 @@ import sys
import subprocess2
from git_common import upstream, current_branch, run, tags, set_branch_config
-from git_common import get_or_create_merge_base, root
+from git_common import get_or_create_merge_base, root, manual_merge_base
import git_rebase_update
@@ -44,7 +44,7 @@ def main(args):
if new_parent == cur_parent:
parser.error('Cannot reparent a branch to its existing parent')
- get_or_create_merge_base(branch, cur_parent)
+ mbase = get_or_create_merge_base(branch, cur_parent)
all_tags = tags()
if cur_parent in all_tags:
@@ -66,6 +66,8 @@ def main(args):
% (branch, new_parent, cur_parent))
run('branch', '--set-upstream-to', new_parent, branch)
+ manual_merge_base(branch, mbase, new_parent)
iannucci 2014/05/15 22:20:17 this sets the same base for the branch given the n
+
# TODO(iannucci): ONLY rebase-update the branch which moved (and dependants)
return git_rebase_update.main(['--no_fetch'])

Powered by Google App Engine
This is Rietveld 408576698