gclient flatten: refactor flatten code to a class
gclient flatten: refactor flatten code to a class

Instead of passing around 6+ out-parameters, keep state inside the class.

No intended behavior change.

Bug: 570091
Change-Id: Ia15c1db2170680f0ec087b61f51af49e12fd7579
Reviewed-on: https://chromium-review.googlesource.com/561700
Commit-Queue: Paweł Hajdan Jr. <84cab74a96a175cf90ed68b8abab420352923e11@chromium.org>
Reviewed-by: Andrii Shyshkalov <a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org>

CoherentLabs/depot_tools,CoherentLabs/depot_tools