Browse Source

[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 <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Allen Li 1 year ago
parent
commit
fa55ddf571
1 changed files with 8 additions and 1 deletions
  1. 8 1
      git_cl.py

+ 8 - 1
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,
         *,