summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subcmds/rebase.py9
-rw-r--r--subcmds/start.py17
2 files changed, 21 insertions, 5 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'
diff --git a/subcmds/start.py b/subcmds/start.py
index 940c3413..d1430a9d 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -57,10 +57,15 @@ revision specified in the manifest.
57 print("error: at least one project must be specified", file=sys.stderr) 57 print("error: at least one project must be specified", file=sys.stderr)
58 sys.exit(1) 58 sys.exit(1)
59 59
60 all_projects = self.GetProjects(projects,
61 missing_ok=bool(self.gitc_manifest))
62
63 # This must happen after we find all_projects, since GetProjects may need
64 # the local directory, which will disappear once we save the GITC manifest.
60 if self.gitc_manifest: 65 if self.gitc_manifest:
61 all_projects = self.GetProjects(projects, manifest=self.gitc_manifest, 66 gitc_projects = self.GetProjects(projects, manifest=self.gitc_manifest,
62 missing_ok=True) 67 missing_ok=True)
63 for project in all_projects: 68 for project in gitc_projects:
64 if project.old_revision: 69 if project.old_revision:
65 project.already_synced = True 70 project.already_synced = True
66 else: 71 else:
@@ -70,8 +75,10 @@ revision specified in the manifest.
70 # Save the GITC manifest. 75 # Save the GITC manifest.
71 gitc_utils.save_manifest(self.gitc_manifest) 76 gitc_utils.save_manifest(self.gitc_manifest)
72 77
73 all_projects = self.GetProjects(projects, 78 # Make sure we have a valid CWD
74 missing_ok=bool(self.gitc_manifest)) 79 if not os.path.exists(os.getcwd()):
80 os.chdir(self.manifest.topdir)
81
75 pm = Progress('Starting %s' % nb, len(all_projects)) 82 pm = Progress('Starting %s' % nb, len(all_projects))
76 for project in all_projects: 83 for project in all_projects:
77 pm.update() 84 pm.update()