mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
forall: handle missing project refs better
If the project exists, but the ref the manifest wants doesn't exist, don't throw an error (and abort the process in general). This can come up with a partially synced tree: the manifest is up-to-date, but not all the projects have yet been synced. Bug: https://crbug.com/gerrit/14289 Change-Id: Iba97413c476544223ffe518198c900c2193a00ed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/301262 Reviewed-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
2ae44d7029
commit
ddab0604ee
@ -24,6 +24,7 @@ import subprocess
|
|||||||
|
|
||||||
from color import Coloring
|
from color import Coloring
|
||||||
from command import DEFAULT_LOCAL_JOBS, Command, MirrorSafeCommand, WORKER_BATCH_SIZE
|
from command import DEFAULT_LOCAL_JOBS, Command, MirrorSafeCommand, WORKER_BATCH_SIZE
|
||||||
|
from error import ManifestInvalidRevisionError
|
||||||
|
|
||||||
_CAN_COLOR = [
|
_CAN_COLOR = [
|
||||||
'branch',
|
'branch',
|
||||||
@ -252,7 +253,7 @@ without iterating through the remaining projects.
|
|||||||
rc = rc or errno.EINTR
|
rc = rc or errno.EINTR
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Catch any other exceptions raised
|
# Catch any other exceptions raised
|
||||||
print('Got an error, terminating the pool: %s: %s' %
|
print('forall: unhandled error, terminating the pool: %s: %s' %
|
||||||
(type(e).__name__, e),
|
(type(e).__name__, e),
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
rc = rc or getattr(e, 'errno', 1)
|
rc = rc or getattr(e, 'errno', 1)
|
||||||
@ -295,7 +296,13 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
|
|||||||
setenv('REPO_PROJECT', project.name)
|
setenv('REPO_PROJECT', project.name)
|
||||||
setenv('REPO_PATH', project.relpath)
|
setenv('REPO_PATH', project.relpath)
|
||||||
setenv('REPO_REMOTE', project.remote.name)
|
setenv('REPO_REMOTE', project.remote.name)
|
||||||
setenv('REPO_LREV', '' if mirror else project.GetRevisionId())
|
try:
|
||||||
|
# If we aren't in a fully synced state and we don't have the ref the manifest
|
||||||
|
# wants, then this will fail. Ignore it for the purposes of this code.
|
||||||
|
lrev = '' if mirror else project.GetRevisionId()
|
||||||
|
except ManifestInvalidRevisionError:
|
||||||
|
lrev = ''
|
||||||
|
setenv('REPO_LREV', lrev)
|
||||||
setenv('REPO_RREV', project.revisionExpr)
|
setenv('REPO_RREV', project.revisionExpr)
|
||||||
setenv('REPO_UPSTREAM', project.upstream)
|
setenv('REPO_UPSTREAM', project.upstream)
|
||||||
setenv('REPO_DEST_BRANCH', project.dest_branch)
|
setenv('REPO_DEST_BRANCH', project.dest_branch)
|
||||||
|
Loading…
Reference in New Issue
Block a user