summaryrefslogtreecommitdiffstats
path: root/subcmds/init.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/init.py')
-rw-r--r--subcmds/init.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index 6d7fd857..868d339e 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -19,6 +19,8 @@ from color import Coloring
19from command import InteractiveCommand, MirrorSafeCommand 19from command import InteractiveCommand, MirrorSafeCommand
20from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD 20from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD
21from wrapper import Wrapper 21from wrapper import Wrapper
22from error import UpdateManifestError
23from error import RepoUnhandledExceptionError
22 24
23_REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW") 25_REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW")
24 26
@@ -156,7 +158,10 @@ to update the working directory files.
156 git_event_log=self.git_event_log, 158 git_event_log=self.git_event_log,
157 manifest_name=opt.manifest_name, 159 manifest_name=opt.manifest_name,
158 ): 160 ):
159 sys.exit(1) 161 manifest_name = opt.manifest_name
162 raise UpdateManifestError(
163 f"Unable to sync manifest {manifest_name}"
164 )
160 165
161 def _Prompt(self, prompt, value): 166 def _Prompt(self, prompt, value):
162 print("%-10s [%s]: " % (prompt, value), end="", flush=True) 167 print("%-10s [%s]: " % (prompt, value), end="", flush=True)
@@ -346,14 +351,15 @@ to update the working directory files.
346 repo_verify=opt.repo_verify, 351 repo_verify=opt.repo_verify,
347 quiet=opt.quiet, 352 quiet=opt.quiet,
348 ) 353 )
349 except wrapper.CloneFailure: 354 except wrapper.CloneFailure as e:
350 err_msg = "fatal: double check your --repo-rev setting." 355 err_msg = "fatal: double check your --repo-rev setting."
351 print( 356 print(
352 err_msg, 357 err_msg,
353 file=sys.stderr, 358 file=sys.stderr,
354 ) 359 )
355 self.git_event_log.ErrorEvent(err_msg) 360 self.git_event_log.ErrorEvent(err_msg)
356 sys.exit(1) 361 raise RepoUnhandledExceptionError(e)
362
357 branch = rp.GetBranch("default") 363 branch = rp.GetBranch("default")
358 branch.merge = remote_ref 364 branch.merge = remote_ref
359 rp.work_git.reset("--hard", rev) 365 rp.work_git.reset("--hard", rev)