Manages project versioning (Git) and ROM artifact snapshots. More...
#include <version_manager.h>

Public Member Functions | |
| VersionManager (project::YazeProject *project) | |
| absl::Status | InitializeGit () |
| absl::StatusOr< SnapshotResult > | CreateSnapshot (const std::string &message) |
| bool | IsGitInitialized () const |
| std::string | GetCurrentHash () const |
| std::vector< std::string > | GetHistory (int limit=10) const |
Private Member Functions | |
| absl::Status | GitInit () |
| absl::Status | GitAddAll () |
| absl::Status | GitCommit (const std::string &message) |
| std::string | GitRevParseHead () const |
| absl::Status | BackupRomArtifact (const std::string ×tamp_str) |
| absl::Status | RunCommand (const std::string &cmd) |
| absl::StatusOr< std::string > | RunCommandOutput (const std::string &cmd) const |
Private Attributes | |
| project::YazeProject * | project_ |
Manages project versioning (Git) and ROM artifact snapshots.
Handles the complexity of separating code (Git) from artifacts (ROMs), ensuring that every "Snapshot" captures both the state of the code and the resulting build artifact.
Definition at line 29 of file version_manager.h.
|
explicit |
Definition at line 20 of file version_manager.cc.
| absl::Status yaze::core::VersionManager::InitializeGit | ( | ) |
Definition at line 31 of file version_manager.cc.
References yaze::project::YazeProject::git_repository, GitInit(), IsGitInitialized(), and project_.
Referenced by CreateSnapshot(), and yaze::editor::ProjectManagementPanel::DrawVersionControl().

| absl::StatusOr< SnapshotResult > yaze::core::VersionManager::CreateSnapshot | ( | const std::string & | message | ) |
Definition at line 46 of file version_manager.cc.
References BackupRomArtifact(), yaze::core::SnapshotResult::commit_hash, GitAddAll(), GitCommit(), GitRevParseHead(), InitializeGit(), IsGitInitialized(), yaze::project::YazeProject::last_build_hash, LOG_ERROR, LOG_INFO, yaze::core::SnapshotResult::message, project_, yaze::core::SnapshotResult::rom_backup_path, and yaze::core::SnapshotResult::success.
Referenced by yaze::editor::AssemblyEditor::DrawAssembleMenu(), and yaze::editor::ProjectManagementPanel::DrawVersionControl().
| bool yaze::core::VersionManager::IsGitInitialized | ( | ) | const |
Definition at line 23 of file version_manager.cc.
References yaze::project::YazeProject::git_repository, and project_.
Referenced by CreateSnapshot(), yaze::editor::ProjectManagementPanel::DrawSnapshotHistory(), yaze::editor::ProjectManagementPanel::DrawVersionControl(), and InitializeGit().
| std::string yaze::core::VersionManager::GetCurrentHash | ( | ) | const |
Definition at line 100 of file version_manager.cc.
References GitRevParseHead().
Referenced by yaze::editor::ProjectManagementPanel::DrawVersionControl().

| std::vector< std::string > yaze::core::VersionManager::GetHistory | ( | int | limit = 10 | ) | const |
Definition at line 104 of file version_manager.cc.
References RunCommandOutput().
Referenced by yaze::editor::ProjectManagementPanel::DrawSnapshotHistory().

|
private |
Definition at line 126 of file version_manager.cc.
References RunCommand().
Referenced by InitializeGit().

|
private |
Definition at line 130 of file version_manager.cc.
References RunCommand().
Referenced by CreateSnapshot().

|
private |
Definition at line 136 of file version_manager.cc.
References RunCommand().
Referenced by CreateSnapshot().

|
private |
Definition at line 144 of file version_manager.cc.
References RunCommandOutput().
Referenced by CreateSnapshot(), and GetCurrentHash().

|
private |
Definition at line 159 of file version_manager.cc.
References yaze::project::YazeProject::build_target, yaze::project::YazeProject::filepath, yaze::project::YazeProject::output_folder, and project_.
Referenced by CreateSnapshot().
|
private |
Definition at line 202 of file version_manager.cc.
References yaze::project::YazeProject::filepath, and project_.
Referenced by GitAddAll(), GitCommit(), and GitInit().
|
private |
Definition at line 227 of file version_manager.cc.
References yaze::project::YazeProject::filepath, and project_.
Referenced by GetHistory(), and GitRevParseHead().
|
private |
Definition at line 56 of file version_manager.h.
Referenced by BackupRomArtifact(), CreateSnapshot(), InitializeGit(), IsGitInitialized(), RunCommand(), and RunCommandOutput().