summaryrefslogtreecommitdiffstats
path: root/subcmds/__init__.py
diff options
context:
space:
mode:
authorJason Chang <jasonnc@google.com>2023-07-26 13:23:40 -0700
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-07-31 21:31:36 +0000
commita6413f5d88f12466b3daa833668d0f59fc65ece4 (patch)
tree25410555a8941c500fbd55a974476ace04198dca /subcmds/__init__.py
parent8c35d948cfa76ec685ad36fb1cb3a0fcc749f428 (diff)
downloadgit-repo-a6413f5d88f12466b3daa833668d0f59fc65ece4.tar.gz
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 <jasonnc@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com>
Diffstat (limited to 'subcmds/__init__.py')
-rw-r--r--subcmds/__init__.py2
1 files changed, 2 insertions, 0 deletions
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
16 16
17# A mapping of the subcommand name to the class that implements it. 17# A mapping of the subcommand name to the class that implements it.
18all_commands = {} 18all_commands = {}
19all_modules = []
19 20
20my_dir = os.path.dirname(__file__) 21my_dir = os.path.dirname(__file__)
21for py in os.listdir(my_dir): 22for py in os.listdir(my_dir):
@@ -42,6 +43,7 @@ for py in os.listdir(my_dir):
42 name = name.replace("_", "-") 43 name = name.replace("_", "-")
43 cmd.NAME = name 44 cmd.NAME = name
44 all_commands[name] = cmd 45 all_commands[name] = cmd
46 all_modules.append(mod)
45 47
46# Add 'branch' as an alias for 'branches'. 48# Add 'branch' as an alias for 'branches'.
47all_commands["branch"] = all_commands["branches"] 49all_commands["branch"] = all_commands["branches"]