diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/sync.py | 4 | ||||
-rw-r--r-- | subcmds/upload.py | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index bbe03722..159771eb 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -1696,7 +1696,7 @@ later is required to fix a server side protocol bug. | |||
1696 | ) | 1696 | ) |
1697 | 1697 | ||
1698 | self._fetch_times = _FetchTimes(manifest) | 1698 | self._fetch_times = _FetchTimes(manifest) |
1699 | self._local_sync_state = _LocalSyncState(manifest) | 1699 | self._local_sync_state = LocalSyncState(manifest) |
1700 | if not opt.local_only: | 1700 | if not opt.local_only: |
1701 | with multiprocessing.Manager() as manager: | 1701 | with multiprocessing.Manager() as manager: |
1702 | with ssh.ProxyManager(manager) as ssh_proxy: | 1702 | with ssh.ProxyManager(manager) as ssh_proxy: |
@@ -1932,7 +1932,7 @@ class _FetchTimes(object): | |||
1932 | platform_utils.remove(self._path, missing_ok=True) | 1932 | platform_utils.remove(self._path, missing_ok=True) |
1933 | 1933 | ||
1934 | 1934 | ||
1935 | class _LocalSyncState(object): | 1935 | class LocalSyncState(object): |
1936 | _LAST_FETCH = "last_fetch" | 1936 | _LAST_FETCH = "last_fetch" |
1937 | _LAST_CHECKOUT = "last_checkout" | 1937 | _LAST_CHECKOUT = "last_checkout" |
1938 | 1938 | ||
diff --git a/subcmds/upload.py b/subcmds/upload.py index 040eaeb5..b89525ce 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -26,6 +26,7 @@ from git_command import GitCommand | |||
26 | from git_refs import R_HEADS | 26 | from git_refs import R_HEADS |
27 | from hooks import RepoHook | 27 | from hooks import RepoHook |
28 | from project import ReviewableBranch | 28 | from project import ReviewableBranch |
29 | from subcmds.sync import LocalSyncState | ||
29 | 30 | ||
30 | 31 | ||
31 | _DEFAULT_UNUSUAL_COMMIT_THRESHOLD = 5 | 32 | _DEFAULT_UNUSUAL_COMMIT_THRESHOLD = 5 |
@@ -804,6 +805,12 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
804 | if not hook.Run( | 805 | if not hook.Run( |
805 | project_list=pending_proj_names, worktree_list=pending_worktrees | 806 | project_list=pending_proj_names, worktree_list=pending_worktrees |
806 | ): | 807 | ): |
808 | if LocalSyncState(manifest).IsPartiallySynced(): | ||
809 | print( | ||
810 | "Partially synced tree detected. Syncing all projects " | ||
811 | "may resolve issues you're seeing.", | ||
812 | file=sys.stderr, | ||
813 | ) | ||
807 | ret = 1 | 814 | ret = 1 |
808 | if ret: | 815 | if ret: |
809 | return ret | 816 | return ret |