From 30d13eea862bdc9df1b0bcd32318f24250dd96ea Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 7 May 2015 15:01:15 +0900 Subject: 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(-) (limited to 'subcmds/forall.py') 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, -- cgit v1.2.3-54-g00ecf From 6944cdb8d1b4765b4e9e6b3f3a09b65495da7ff3 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 7 May 2015 14:39:44 +0900 Subject: forall: use smart sync override manifest if it exists If a workspace is synced with the -s or -t option, the included projects may be different to those in the original manifest. However, when using the forall command, the list of the projects from the original manifest is used. If the smart sync manifest file exists, use it to override the original manifest. Change-Id: Iaefcbe148d2158ac046f158d98bbd8b5a5378ce7 --- subcmds/forall.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'subcmds/forall.py') diff --git a/subcmds/forall.py b/subcmds/forall.py index 3ddc3c3d..b93cd6d0 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -205,6 +205,13 @@ without iterating through the remaining projects. mirror = self.manifest.IsMirror rc = 0 + smart_sync_manifest_name = "smart_sync_override.xml" + smart_sync_manifest_path = os.path.join( + self.manifest.manifestProject.worktree, smart_sync_manifest_name) + + if os.path.isfile(smart_sync_manifest_path): + self.manifest.Override(smart_sync_manifest_path) + if not opt.regex: projects = self.GetProjects(args) else: -- cgit v1.2.3-54-g00ecf