From 30d13eea862bdc9df1b0bcd32318f24250dd96ea Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 7 May 2015 15:01:15 +0900 Subject: [PATCH] forall: Don't try to get lrev of projects in mirror workspace git rev-parse fails for projects that don't have an explicit revision specified, and don't have a branch of the same name as the default revision. This can be the case in a workspace synced with the smart sync (-s) or smart tag (-t) option. Change-Id: I19bfe9fe7396170379415d85f10f6440dc6ea08f --- subcmds/forall.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subcmds/forall.py b/subcmds/forall.py index ebc8beca..3ddc3c3d 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -151,11 +151,15 @@ without iterating through the remaining projects. attributes that we need. """ + if not self.manifest.IsMirror: + lrev = project.GetRevisionId() + else: + lrev = None return { 'name': project.name, 'relpath': project.relpath, 'remote_name': project.remote.name, - 'lrev': project.GetRevisionId(), + 'lrev': lrev, 'rrev': project.revisionExpr, 'annotations': dict((a.name, a.value) for a in project.annotations), 'gitdir': project.gitdir,