From a6413f5d88f12466b3daa833668d0f59fc65ece4 Mon Sep 17 00:00:00 2001 From: Jason Chang Date: Wed, 26 Jul 2023 13:23:40 -0700 Subject: Update errors to extend BaseRepoError In order to better analyze and track repo errors, repo command failures need to be tied to specific errors in repo source code. Additionally a new GitCommandError was added to differentiate between general git related errors to failed git commands. Git commands that opt into verification will raise a GitCommandError if the command failed. The first step in this process is a general error refactoring Bug: b/293344017 Change-Id: I46944b1825ce892757c8dd3f7e2fab7e460760c0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/380994 Commit-Queue: Jason Chang Reviewed-by: Aravind Vasudevan Tested-by: Jason Chang Reviewed-by: Joanna Wang --- subcmds/__init__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'subcmds/__init__.py') diff --git a/subcmds/__init__.py b/subcmds/__init__.py index 4e41afc0..0754f708 100644 --- a/subcmds/__init__.py +++ b/subcmds/__init__.py @@ -16,6 +16,7 @@ import os # A mapping of the subcommand name to the class that implements it. all_commands = {} +all_modules = [] my_dir = os.path.dirname(__file__) for py in os.listdir(my_dir): @@ -42,6 +43,7 @@ for py in os.listdir(my_dir): name = name.replace("_", "-") cmd.NAME = name all_commands[name] = cmd + all_modules.append(mod) # Add 'branch' as an alias for 'branches'. all_commands["branch"] = all_commands["branches"] -- cgit v1.2.3-54-g00ecf