summaryrefslogtreecommitdiffstats
path: root/subcmds/forall.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/forall.py')
-rw-r--r--subcmds/forall.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py
index aa998d20..f0ce97cb 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -24,6 +24,7 @@ import subprocess
24 24
25from color import Coloring 25from color import Coloring
26from command import DEFAULT_LOCAL_JOBS, Command, MirrorSafeCommand, WORKER_BATCH_SIZE 26from command import DEFAULT_LOCAL_JOBS, Command, MirrorSafeCommand, WORKER_BATCH_SIZE
27from error import ManifestInvalidRevisionError
27 28
28_CAN_COLOR = [ 29_CAN_COLOR = [
29 'branch', 30 'branch',
@@ -252,7 +253,7 @@ without iterating through the remaining projects.
252 rc = rc or errno.EINTR 253 rc = rc or errno.EINTR
253 except Exception as e: 254 except Exception as e:
254 # Catch any other exceptions raised 255 # Catch any other exceptions raised
255 print('Got an error, terminating the pool: %s: %s' % 256 print('forall: unhandled error, terminating the pool: %s: %s' %
256 (type(e).__name__, e), 257 (type(e).__name__, e),
257 file=sys.stderr) 258 file=sys.stderr)
258 rc = rc or getattr(e, 'errno', 1) 259 rc = rc or getattr(e, 'errno', 1)
@@ -295,7 +296,13 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
295 setenv('REPO_PROJECT', project.name) 296 setenv('REPO_PROJECT', project.name)
296 setenv('REPO_PATH', project.relpath) 297 setenv('REPO_PATH', project.relpath)
297 setenv('REPO_REMOTE', project.remote.name) 298 setenv('REPO_REMOTE', project.remote.name)
298 setenv('REPO_LREV', '' if mirror else project.GetRevisionId()) 299 try:
300 # If we aren't in a fully synced state and we don't have the ref the manifest
301 # wants, then this will fail. Ignore it for the purposes of this code.
302 lrev = '' if mirror else project.GetRevisionId()
303 except ManifestInvalidRevisionError:
304 lrev = ''
305 setenv('REPO_LREV', lrev)
299 setenv('REPO_RREV', project.revisionExpr) 306 setenv('REPO_RREV', project.revisionExpr)
300 setenv('REPO_UPSTREAM', project.upstream) 307 setenv('REPO_UPSTREAM', project.upstream)
301 setenv('REPO_DEST_BRANCH', project.dest_branch) 308 setenv('REPO_DEST_BRANCH', project.dest_branch)