From 0b4cb325c6f412ac5ab33573b4f5e50b4945c924 Mon Sep 17 00:00:00 2001 From: Xiaohui Chen Date: Wed, 27 Jan 2016 14:33:51 -0800 Subject: [PATCH] Add option to rebase onto project's manifest version Some teams have a continuous build server that would mark certain manifest green and safe to sync to. Then team members could repo sync to that particular manifest file and make sure they always sync to a green build. But if she/he has some local changes and wants to rebase, currently it would be a manual process to find the correct version to rebase onto. This patch helps with that use case by automating the process to rebase onto the currently synced manifest version. Change-Id: I847c9eb6addf7f84fd3f5594fbf8c0bcc103f9a5 --- subcmds/rebase.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subcmds/rebase.py b/subcmds/rebase.py index 1bdc1f0b..74796970 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py @@ -54,6 +54,11 @@ branch but need to incorporate new upstream changes "underneath" them. p.add_option('--auto-stash', dest='auto_stash', action='store_true', help='Stash local modifications before starting') + p.add_option('-m', '--onto-manifest', + dest='onto_manifest', action='store_true', + help='Rebase onto the manifest version instead of upstream ' + 'HEAD. This helps to make sure the local tree stays ' + 'consistent if you previously synced to a manifest.') def Execute(self, opt, args): all_projects = self.GetProjects(args) @@ -106,6 +111,10 @@ branch but need to incorporate new upstream changes "underneath" them. if opt.interactive: args.append("-i") + if opt.onto_manifest: + args.append('--onto') + args.append(project.revisionExpr) + args.append(upbranch.LocalMerge) print('# %s: rebasing %s -> %s'