summaryrefslogtreecommitdiffstats
path: root/subcmds/rebase.py
diff options
context:
space:
mode:
authorXiaohui Chen <xiaohuic@google.com>2016-01-27 14:33:51 -0800
committerXiaohui Chen <xiaohuic@google.com>2016-01-28 10:20:03 -0800
commit0b4cb325c6f412ac5ab33573b4f5e50b4945c924 (patch)
treec09284588db5cd85958c9270bba63b41b67a15d4 /subcmds/rebase.py
parente9becc079c647f6c9477eed83c0aecb2f591fdf4 (diff)
downloadgit-repo-0b4cb325c6f412ac5ab33573b4f5e50b4945c924.tar.gz
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
Diffstat (limited to 'subcmds/rebase.py')
-rw-r--r--subcmds/rebase.py9
1 files changed, 9 insertions, 0 deletions
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.
54 p.add_option('--auto-stash', 54 p.add_option('--auto-stash',
55 dest='auto_stash', action='store_true', 55 dest='auto_stash', action='store_true',
56 help='Stash local modifications before starting') 56 help='Stash local modifications before starting')
57 p.add_option('-m', '--onto-manifest',
58 dest='onto_manifest', action='store_true',
59 help='Rebase onto the manifest version instead of upstream '
60 'HEAD. This helps to make sure the local tree stays '
61 'consistent if you previously synced to a manifest.')
57 62
58 def Execute(self, opt, args): 63 def Execute(self, opt, args):
59 all_projects = self.GetProjects(args) 64 all_projects = self.GetProjects(args)
@@ -106,6 +111,10 @@ branch but need to incorporate new upstream changes "underneath" them.
106 if opt.interactive: 111 if opt.interactive:
107 args.append("-i") 112 args.append("-i")
108 113
114 if opt.onto_manifest:
115 args.append('--onto')
116 args.append(project.revisionExpr)
117
109 args.append(upbranch.LocalMerge) 118 args.append(upbranch.LocalMerge)
110 119
111 print('# %s: rebasing %s -> %s' 120 print('# %s: rebasing %s -> %s'