diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/__init__.py | 1 | ||||
| -rw-r--r-- | subcmds/abandon.py | 6 | ||||
| -rw-r--r-- | subcmds/branches.py | 3 | ||||
| -rw-r--r-- | subcmds/checkout.py | 8 | ||||
| -rw-r--r-- | subcmds/cherry_pick.py | 4 | ||||
| -rw-r--r-- | subcmds/diff.py | 3 | ||||
| -rw-r--r-- | subcmds/download.py | 5 | ||||
| -rw-r--r-- | subcmds/forall.py | 15 | ||||
| -rw-r--r-- | subcmds/grep.py | 9 | ||||
| -rw-r--r-- | subcmds/help.py | 10 | ||||
| -rw-r--r-- | subcmds/info.py | 5 | ||||
| -rw-r--r-- | subcmds/init.py | 12 | ||||
| -rw-r--r-- | subcmds/list.py | 3 | ||||
| -rw-r--r-- | subcmds/prune.py | 3 | ||||
| -rw-r--r-- | subcmds/selfupdate.py | 7 | ||||
| -rw-r--r-- | subcmds/start.py | 9 | ||||
| -rw-r--r-- | subcmds/status.py | 4 | ||||
| -rw-r--r-- | subcmds/sync.py | 40 | ||||
| -rw-r--r-- | subcmds/upload.py | 7 | ||||
| -rw-r--r-- | subcmds/version.py | 7 |
20 files changed, 95 insertions, 66 deletions
diff --git a/subcmds/__init__.py b/subcmds/__init__.py index 0754f708..965ad0bb 100644 --- a/subcmds/__init__.py +++ b/subcmds/__init__.py | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | import os | 15 | import os |
| 16 | 16 | ||
| 17 | |||
| 17 | # A mapping of the subcommand name to the class that implements it. | 18 | # A mapping of the subcommand name to the class that implements it. |
| 18 | all_commands = {} | 19 | all_commands = {} |
| 19 | all_modules = [] | 20 | all_modules = [] |
diff --git a/subcmds/abandon.py b/subcmds/abandon.py index 1499c75e..996c3d2c 100644 --- a/subcmds/abandon.py +++ b/subcmds/abandon.py | |||
| @@ -17,10 +17,12 @@ import functools | |||
| 17 | import itertools | 17 | import itertools |
| 18 | import sys | 18 | import sys |
| 19 | 19 | ||
| 20 | from command import Command, DEFAULT_LOCAL_JOBS | 20 | from command import Command |
| 21 | from command import DEFAULT_LOCAL_JOBS | ||
| 22 | from error import RepoError | ||
| 23 | from error import RepoExitError | ||
| 21 | from git_command import git | 24 | from git_command import git |
| 22 | from progress import Progress | 25 | from progress import Progress |
| 23 | from error import RepoError, RepoExitError | ||
| 24 | 26 | ||
| 25 | 27 | ||
| 26 | class AbandonError(RepoExitError): | 28 | class AbandonError(RepoExitError): |
diff --git a/subcmds/branches.py b/subcmds/branches.py index 4d5bb196..33523c38 100644 --- a/subcmds/branches.py +++ b/subcmds/branches.py | |||
| @@ -16,7 +16,8 @@ import itertools | |||
| 16 | import sys | 16 | import sys |
| 17 | 17 | ||
| 18 | from color import Coloring | 18 | from color import Coloring |
| 19 | from command import Command, DEFAULT_LOCAL_JOBS | 19 | from command import Command |
| 20 | from command import DEFAULT_LOCAL_JOBS | ||
| 20 | 21 | ||
| 21 | 22 | ||
| 22 | class BranchColoring(Coloring): | 23 | class BranchColoring(Coloring): |
diff --git a/subcmds/checkout.py b/subcmds/checkout.py index 033fd349..67f1838c 100644 --- a/subcmds/checkout.py +++ b/subcmds/checkout.py | |||
| @@ -14,12 +14,14 @@ | |||
| 14 | 14 | ||
| 15 | import functools | 15 | import functools |
| 16 | import sys | 16 | import sys |
| 17 | |||
| 18 | from typing import NamedTuple | 17 | from typing import NamedTuple |
| 19 | from command import Command, DEFAULT_LOCAL_JOBS | 18 | |
| 19 | from command import Command | ||
| 20 | from command import DEFAULT_LOCAL_JOBS | ||
| 21 | from error import GitError | ||
| 22 | from error import RepoExitError | ||
| 20 | from progress import Progress | 23 | from progress import Progress |
| 21 | from project import Project | 24 | from project import Project |
| 22 | from error import GitError, RepoExitError | ||
| 23 | 25 | ||
| 24 | 26 | ||
| 25 | class CheckoutBranchResult(NamedTuple): | 27 | class CheckoutBranchResult(NamedTuple): |
diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py index 7a4dd09e..980720eb 100644 --- a/subcmds/cherry_pick.py +++ b/subcmds/cherry_pick.py | |||
| @@ -14,9 +14,11 @@ | |||
| 14 | 14 | ||
| 15 | import re | 15 | import re |
| 16 | import sys | 16 | import sys |
| 17 | |||
| 17 | from command import Command | 18 | from command import Command |
| 18 | from git_command import GitCommand | ||
| 19 | from error import GitError | 19 | from error import GitError |
| 20 | from git_command import GitCommand | ||
| 21 | |||
| 20 | 22 | ||
| 21 | CHANGE_ID_RE = re.compile(r"^\s*Change-Id: I([0-9a-f]{40})\s*$") | 23 | CHANGE_ID_RE = re.compile(r"^\s*Change-Id: I([0-9a-f]{40})\s*$") |
| 22 | 24 | ||
diff --git a/subcmds/diff.py b/subcmds/diff.py index 5c627c0c..d9d72b40 100644 --- a/subcmds/diff.py +++ b/subcmds/diff.py | |||
| @@ -15,7 +15,8 @@ | |||
| 15 | import functools | 15 | import functools |
| 16 | import io | 16 | import io |
| 17 | 17 | ||
| 18 | from command import DEFAULT_LOCAL_JOBS, PagedCommand | 18 | from command import DEFAULT_LOCAL_JOBS |
| 19 | from command import PagedCommand | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | class Diff(PagedCommand): | 22 | class Diff(PagedCommand): |
diff --git a/subcmds/download.py b/subcmds/download.py index 18e555be..e33698e1 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
| @@ -16,7 +16,10 @@ import re | |||
| 16 | import sys | 16 | import sys |
| 17 | 17 | ||
| 18 | from command import Command | 18 | from command import Command |
| 19 | from error import GitError, NoSuchProjectError, RepoExitError | 19 | from error import GitError |
| 20 | from error import NoSuchProjectError | ||
| 21 | from error import RepoExitError | ||
| 22 | |||
| 20 | 23 | ||
| 21 | CHANGE_RE = re.compile(r"^([1-9][0-9]*)(?:[/\.-]([1-9][0-9]*))?$") | 24 | CHANGE_RE = re.compile(r"^([1-9][0-9]*)(?:[/\.-]([1-9][0-9]*))?$") |
| 22 | 25 | ||
diff --git a/subcmds/forall.py b/subcmds/forall.py index 0a897357..9a02c49f 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
| @@ -16,21 +16,20 @@ import errno | |||
| 16 | import functools | 16 | import functools |
| 17 | import io | 17 | import io |
| 18 | import multiprocessing | 18 | import multiprocessing |
| 19 | import re | ||
| 20 | import os | 19 | import os |
| 20 | import re | ||
| 21 | import signal | 21 | import signal |
| 22 | import sys | ||
| 23 | import subprocess | 22 | import subprocess |
| 23 | import sys | ||
| 24 | 24 | ||
| 25 | from color import Coloring | 25 | from color import Coloring |
| 26 | from command import ( | 26 | from command import Command |
| 27 | DEFAULT_LOCAL_JOBS, | 27 | from command import DEFAULT_LOCAL_JOBS |
| 28 | Command, | 28 | from command import MirrorSafeCommand |
| 29 | MirrorSafeCommand, | 29 | from command import WORKER_BATCH_SIZE |
| 30 | WORKER_BATCH_SIZE, | ||
| 31 | ) | ||
| 32 | from error import ManifestInvalidRevisionError | 30 | from error import ManifestInvalidRevisionError |
| 33 | 31 | ||
| 32 | |||
| 34 | _CAN_COLOR = [ | 33 | _CAN_COLOR = [ |
| 35 | "branch", | 34 | "branch", |
| 36 | "diff", | 35 | "diff", |
diff --git a/subcmds/grep.py b/subcmds/grep.py index 9ebd776c..19c06d4d 100644 --- a/subcmds/grep.py +++ b/subcmds/grep.py | |||
| @@ -14,12 +14,15 @@ | |||
| 14 | 14 | ||
| 15 | import functools | 15 | import functools |
| 16 | import sys | 16 | import sys |
| 17 | from typing import NamedTuple | ||
| 17 | 18 | ||
| 18 | from color import Coloring | 19 | from color import Coloring |
| 19 | from command import DEFAULT_LOCAL_JOBS, PagedCommand | 20 | from command import DEFAULT_LOCAL_JOBS |
| 20 | from error import GitError, InvalidArgumentsError, SilentRepoExitError | 21 | from command import PagedCommand |
| 22 | from error import GitError | ||
| 23 | from error import InvalidArgumentsError | ||
| 24 | from error import SilentRepoExitError | ||
| 21 | from git_command import GitCommand | 25 | from git_command import GitCommand |
| 22 | from typing import NamedTuple | ||
| 23 | from project import Project | 26 | from project import Project |
| 24 | 27 | ||
| 25 | 28 | ||
diff --git a/subcmds/help.py b/subcmds/help.py index 0d7b664e..a839131b 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
| @@ -16,14 +16,12 @@ import re | |||
| 16 | import sys | 16 | import sys |
| 17 | import textwrap | 17 | import textwrap |
| 18 | 18 | ||
| 19 | from subcmds import all_commands | ||
| 20 | from color import Coloring | 19 | from color import Coloring |
| 21 | from command import ( | 20 | from command import MirrorSafeCommand |
| 22 | PagedCommand, | 21 | from command import PagedCommand |
| 23 | MirrorSafeCommand, | ||
| 24 | ) | ||
| 25 | from wrapper import Wrapper | ||
| 26 | from error import RepoExitError | 22 | from error import RepoExitError |
| 23 | from subcmds import all_commands | ||
| 24 | from wrapper import Wrapper | ||
| 27 | 25 | ||
| 28 | 26 | ||
| 29 | class InvalidHelpCommand(RepoExitError): | 27 | class InvalidHelpCommand(RepoExitError): |
diff --git a/subcmds/info.py b/subcmds/info.py index 6e7f3ed2..c24682c7 100644 --- a/subcmds/info.py +++ b/subcmds/info.py | |||
| @@ -14,9 +14,10 @@ | |||
| 14 | 14 | ||
| 15 | import optparse | 15 | import optparse |
| 16 | 16 | ||
| 17 | from command import PagedCommand | ||
| 18 | from color import Coloring | 17 | from color import Coloring |
| 19 | from git_refs import R_M, R_HEADS | 18 | from command import PagedCommand |
| 19 | from git_refs import R_HEADS | ||
| 20 | from git_refs import R_M | ||
| 20 | 21 | ||
| 21 | 22 | ||
| 22 | class _Coloring(Coloring): | 23 | class _Coloring(Coloring): |
diff --git a/subcmds/init.py b/subcmds/init.py index c5a2c54c..529b212b 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -16,11 +16,15 @@ import os | |||
| 16 | import sys | 16 | import sys |
| 17 | 17 | ||
| 18 | from color import Coloring | 18 | from color import Coloring |
| 19 | from command import InteractiveCommand, MirrorSafeCommand | 19 | from command import InteractiveCommand |
| 20 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD | 20 | from command import MirrorSafeCommand |
| 21 | from wrapper import Wrapper | ||
| 22 | from error import UpdateManifestError | ||
| 23 | from error import RepoUnhandledExceptionError | 21 | from error import RepoUnhandledExceptionError |
| 22 | from error import UpdateManifestError | ||
| 23 | from git_command import git_require | ||
| 24 | from git_command import MIN_GIT_VERSION_HARD | ||
| 25 | from git_command import MIN_GIT_VERSION_SOFT | ||
| 26 | from wrapper import Wrapper | ||
| 27 | |||
| 24 | 28 | ||
| 25 | _REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW") | 29 | _REPO_ALLOW_SHALLOW = os.environ.get("REPO_ALLOW_SHALLOW") |
| 26 | 30 | ||
diff --git a/subcmds/list.py b/subcmds/list.py index 24e3e1fc..fba6a4dc 100644 --- a/subcmds/list.py +++ b/subcmds/list.py | |||
| @@ -14,7 +14,8 @@ | |||
| 14 | 14 | ||
| 15 | import os | 15 | import os |
| 16 | 16 | ||
| 17 | from command import Command, MirrorSafeCommand | 17 | from command import Command |
| 18 | from command import MirrorSafeCommand | ||
| 18 | 19 | ||
| 19 | 20 | ||
| 20 | class List(Command, MirrorSafeCommand): | 21 | class List(Command, MirrorSafeCommand): |
diff --git a/subcmds/prune.py b/subcmds/prune.py index 5a68c14a..f18471f3 100644 --- a/subcmds/prune.py +++ b/subcmds/prune.py | |||
| @@ -15,7 +15,8 @@ | |||
| 15 | import itertools | 15 | import itertools |
| 16 | 16 | ||
| 17 | from color import Coloring | 17 | from color import Coloring |
| 18 | from command import DEFAULT_LOCAL_JOBS, PagedCommand | 18 | from command import DEFAULT_LOCAL_JOBS |
| 19 | from command import PagedCommand | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | class Prune(PagedCommand): | 22 | class Prune(PagedCommand): |
diff --git a/subcmds/selfupdate.py b/subcmds/selfupdate.py index 983fd630..51d963ee 100644 --- a/subcmds/selfupdate.py +++ b/subcmds/selfupdate.py | |||
| @@ -15,10 +15,11 @@ | |||
| 15 | import optparse | 15 | import optparse |
| 16 | import sys | 16 | import sys |
| 17 | 17 | ||
| 18 | from command import Command, MirrorSafeCommand | 18 | from command import Command |
| 19 | from subcmds.sync import _PostRepoUpgrade | 19 | from command import MirrorSafeCommand |
| 20 | from subcmds.sync import _PostRepoFetch | ||
| 21 | from error import RepoExitError | 20 | from error import RepoExitError |
| 21 | from subcmds.sync import _PostRepoFetch | ||
| 22 | from subcmds.sync import _PostRepoUpgrade | ||
| 22 | 23 | ||
| 23 | 24 | ||
| 24 | class SelfupdateError(RepoExitError): | 25 | class SelfupdateError(RepoExitError): |
diff --git a/subcmds/start.py b/subcmds/start.py index 481d9ef2..7a42b26c 100644 --- a/subcmds/start.py +++ b/subcmds/start.py | |||
| @@ -14,14 +14,15 @@ | |||
| 14 | 14 | ||
| 15 | import functools | 15 | import functools |
| 16 | import sys | 16 | import sys |
| 17 | from typing import NamedTuple | ||
| 17 | 18 | ||
| 18 | from command import Command, DEFAULT_LOCAL_JOBS | 19 | from command import Command |
| 19 | from git_config import IsImmutable | 20 | from command import DEFAULT_LOCAL_JOBS |
| 21 | from error import RepoExitError | ||
| 20 | from git_command import git | 22 | from git_command import git |
| 23 | from git_config import IsImmutable | ||
| 21 | from progress import Progress | 24 | from progress import Progress |
| 22 | from project import Project | 25 | from project import Project |
| 23 | from typing import NamedTuple | ||
| 24 | from error import RepoExitError | ||
| 25 | 26 | ||
| 26 | 27 | ||
| 27 | class ExecuteOneResult(NamedTuple): | 28 | class ExecuteOneResult(NamedTuple): |
diff --git a/subcmds/status.py b/subcmds/status.py index 6e0026f9..dac61ab6 100644 --- a/subcmds/status.py +++ b/subcmds/status.py | |||
| @@ -17,9 +17,9 @@ import glob | |||
| 17 | import io | 17 | import io |
| 18 | import os | 18 | import os |
| 19 | 19 | ||
| 20 | from command import DEFAULT_LOCAL_JOBS, PagedCommand | ||
| 21 | |||
| 22 | from color import Coloring | 20 | from color import Coloring |
| 21 | from command import DEFAULT_LOCAL_JOBS | ||
| 22 | from command import PagedCommand | ||
| 23 | import platform_utils | 23 | import platform_utils |
| 24 | 24 | ||
| 25 | 25 | ||
diff --git a/subcmds/sync.py b/subcmds/sync.py index 74bc4557..13c964b2 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -25,13 +25,14 @@ import socket | |||
| 25 | import sys | 25 | import sys |
| 26 | import tempfile | 26 | import tempfile |
| 27 | import time | 27 | import time |
| 28 | from typing import NamedTuple, List, Set | 28 | from typing import List, NamedTuple, Set |
| 29 | import urllib.error | 29 | import urllib.error |
| 30 | import urllib.parse | 30 | import urllib.parse |
| 31 | import urllib.request | 31 | import urllib.request |
| 32 | import xml.parsers.expat | 32 | import xml.parsers.expat |
| 33 | import xmlrpc.client | 33 | import xmlrpc.client |
| 34 | 34 | ||
| 35 | |||
| 35 | try: | 36 | try: |
| 36 | import threading as _threading | 37 | import threading as _threading |
| 37 | except ImportError: | 38 | except ImportError: |
| @@ -49,34 +50,35 @@ except ImportError: | |||
| 49 | return (256, 256) | 50 | return (256, 256) |
| 50 | 51 | ||
| 51 | 52 | ||
| 53 | from command import Command | ||
| 54 | from command import DEFAULT_LOCAL_JOBS | ||
| 55 | from command import MirrorSafeCommand | ||
| 56 | from command import WORKER_BATCH_SIZE | ||
| 57 | from error import GitError | ||
| 58 | from error import RepoChangedException | ||
| 59 | from error import RepoExitError | ||
| 60 | from error import RepoUnhandledExceptionError | ||
| 61 | from error import SyncError | ||
| 62 | from error import UpdateManifestError | ||
| 52 | import event_log | 63 | import event_log |
| 53 | from git_command import git_require | 64 | from git_command import git_require |
| 54 | from git_config import GetUrlCookieFile | 65 | from git_config import GetUrlCookieFile |
| 55 | from git_refs import R_HEADS, HEAD | 66 | from git_refs import HEAD |
| 67 | from git_refs import R_HEADS | ||
| 56 | import git_superproject | 68 | import git_superproject |
| 69 | import platform_utils | ||
| 70 | from progress import elapsed_str | ||
| 71 | from progress import jobs_str | ||
| 72 | from progress import Progress | ||
| 73 | from project import DeleteWorktreeError | ||
| 57 | from project import Project | 74 | from project import Project |
| 58 | from project import RemoteSpec | 75 | from project import RemoteSpec |
| 59 | from command import ( | 76 | from project import SyncBuffer |
| 60 | Command, | ||
| 61 | DEFAULT_LOCAL_JOBS, | ||
| 62 | MirrorSafeCommand, | ||
| 63 | WORKER_BATCH_SIZE, | ||
| 64 | ) | ||
| 65 | from error import ( | ||
| 66 | RepoChangedException, | ||
| 67 | GitError, | ||
| 68 | RepoExitError, | ||
| 69 | SyncError, | ||
| 70 | UpdateManifestError, | ||
| 71 | RepoUnhandledExceptionError, | ||
| 72 | ) | ||
| 73 | import platform_utils | ||
| 74 | from project import SyncBuffer, DeleteWorktreeError | ||
| 75 | from progress import Progress, elapsed_str, jobs_str | ||
| 76 | from repo_trace import Trace | 77 | from repo_trace import Trace |
| 77 | import ssh | 78 | import ssh |
| 78 | from wrapper import Wrapper | 79 | from wrapper import Wrapper |
| 79 | 80 | ||
| 81 | |||
| 80 | _ONE_DAY_S = 24 * 60 * 60 | 82 | _ONE_DAY_S = 24 * 60 * 60 |
| 81 | 83 | ||
| 82 | # Env var to implicitly turn auto-gc back on. This was added to allow a user to | 84 | # Env var to implicitly turn auto-gc back on. This was added to allow a user to |
diff --git a/subcmds/upload.py b/subcmds/upload.py index b89525ce..ec89ad43 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -19,9 +19,12 @@ import re | |||
| 19 | import sys | 19 | import sys |
| 20 | from typing import List | 20 | from typing import List |
| 21 | 21 | ||
| 22 | from command import DEFAULT_LOCAL_JOBS, InteractiveCommand | 22 | from command import DEFAULT_LOCAL_JOBS |
| 23 | from command import InteractiveCommand | ||
| 23 | from editor import Editor | 24 | from editor import Editor |
| 24 | from error import UploadError, SilentRepoExitError, GitError | 25 | from error import GitError |
| 26 | from error import SilentRepoExitError | ||
| 27 | from error import UploadError | ||
| 25 | from git_command import GitCommand | 28 | from git_command import GitCommand |
| 26 | from git_refs import R_HEADS | 29 | from git_refs import R_HEADS |
| 27 | from hooks import RepoHook | 30 | from hooks import RepoHook |
diff --git a/subcmds/version.py b/subcmds/version.py index c539db63..71a03608 100644 --- a/subcmds/version.py +++ b/subcmds/version.py | |||
| @@ -15,8 +15,11 @@ | |||
| 15 | import platform | 15 | import platform |
| 16 | import sys | 16 | import sys |
| 17 | 17 | ||
| 18 | from command import Command, MirrorSafeCommand | 18 | from command import Command |
| 19 | from git_command import git, RepoSourceVersion, user_agent | 19 | from command import MirrorSafeCommand |
| 20 | from git_command import git | ||
| 21 | from git_command import RepoSourceVersion | ||
| 22 | from git_command import user_agent | ||
| 20 | from git_refs import HEAD | 23 | from git_refs import HEAD |
| 21 | from wrapper import Wrapper | 24 | from wrapper import Wrapper |
| 22 | 25 | ||
