Make marked merge base invalid when the upstream changes.

This should let the base marker transparently work with plain-old-git tools
which was the idea in the first place. Specifically `git branch -u` without a
corresponding rebase.

R=agable@chromium.org
BUG=373977

Review URL: https://codereview.chromium.org/288323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@271112 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
iannucci@chromium.org
2014-05-16 22:31:13 +00:00
parent 279c21881c
commit 10fbe879aa
5 changed files with 51 additions and 15 deletions

View File

@@ -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)
# TODO(iannucci): ONLY rebase-update the branch which moved (and dependants)
return git_rebase_update.main(['--no_fetch'])