From fa55ddf5712ce76419d74e57d053076ad4155b4c Mon Sep 17 00:00:00 2001 From: Allen Li Date: Tue, 16 Jul 2024 22:06:36 +0000 Subject: [PATCH] [git_cl] Move git new auth config version to constant Bug: b/351024645 Change-Id: I9454c6678d5754d21d6db9ac1574266e9127034f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5698378 Reviewed-by: Yiwei Zhang Commit-Queue: Allen Li --- git_cl.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 02e5b45b6..52e22f657 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2344,7 +2344,7 @@ class Changelist(object): return if newauth.Enabled(): - latestVer = 1 + latestVer: int = GitAuthConfigChanger.VERSION v: int = 0 try: v = int( @@ -3684,6 +3684,13 @@ class GitConfigMode(enum.Enum): class GitAuthConfigChanger(object): """Changes Git auth config as needed for Gerrit.""" + # Can be used to determine whether this version of the config has + # been applied to a Git repo. + # + # Increment this when making changes to the config, so that reliant + # code can determine whether the config needs to be re-applied. + VERSION: int = 1 + def __init__( self, *,