From 8c1e9cbef161f2ff12dadbacf26affd23876fde9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 6 Sep 2020 14:53:18 -0400 Subject: manifest_xml: refactor manifest parsing from client management We conflate the manifest & parsing logic with the management of the repo client checkout in a single class. This makes testing just one part (the manifest parsing) hard as it requires a full checkout too. Start splitting the two apart into separate classes to make it easy to reason about & test. Change-Id: Iaf897c93db9c724baba6044bfe7a589c024523b2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/288682 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- subcmds/diffmanifests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'subcmds/diffmanifests.py') diff --git a/subcmds/diffmanifests.py b/subcmds/diffmanifests.py index 72c441ac..409bbdac 100644 --- a/subcmds/diffmanifests.py +++ b/subcmds/diffmanifests.py @@ -16,7 +16,7 @@ from color import Coloring from command import PagedCommand -from manifest_xml import XmlManifest +from manifest_xml import RepoClient class _Coloring(Coloring): @@ -183,7 +183,7 @@ synced and their revisions won't be found. self.OptionParser.error('missing manifests to diff') def Execute(self, opt, args): - self.out = _Coloring(self.manifest.globalConfig) + self.out = _Coloring(self.client.globalConfig) self.printText = self.out.nofmt_printer('text') if opt.color: self.printProject = self.out.nofmt_printer('project', attr='bold') @@ -193,12 +193,12 @@ synced and their revisions won't be found. else: self.printProject = self.printAdded = self.printRemoved = self.printRevision = self.printText - manifest1 = XmlManifest(self.manifest.repodir) + manifest1 = RepoClient(self.manifest.repodir) manifest1.Override(args[0], load_local_manifests=False) if len(args) == 1: manifest2 = self.manifest else: - manifest2 = XmlManifest(self.manifest.repodir) + manifest2 = RepoClient(self.manifest.repodir) manifest2.Override(args[1], load_local_manifests=False) diff = manifest1.projectsDiff(manifest2) -- cgit v1.2.3-54-g00ecf