yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::core::VersionManager Class Reference

Manages project versioning (Git) and ROM artifact snapshots. More...

#include <version_manager.h>

Collaboration diagram for yaze::core::VersionManager:

Public Member Functions

 VersionManager (project::YazeProject *project)
 
absl::Status InitializeGit ()
 
absl::StatusOr< SnapshotResultCreateSnapshot (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 &timestamp_str)
 
absl::Status RunCommand (const std::string &cmd)
 
absl::StatusOr< std::string > RunCommandOutput (const std::string &cmd) const
 

Private Attributes

project::YazeProjectproject_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ VersionManager()

yaze::core::VersionManager::VersionManager ( project::YazeProject * project)
explicit

Definition at line 20 of file version_manager.cc.

Member Function Documentation

◆ InitializeGit()

absl::Status yaze::core::VersionManager::InitializeGit ( )

Definition at line 29 of file version_manager.cc.

References yaze::project::YazeProject::git_repository, GitInit(), IsGitInitialized(), and project_.

Referenced by CreateSnapshot(), and yaze::editor::ProjectManagementPanel::DrawVersionControl().

Here is the call graph for this function:

◆ CreateSnapshot()

◆ IsGitInitialized()

◆ GetCurrentHash()

std::string yaze::core::VersionManager::GetCurrentHash ( ) const

Definition at line 91 of file version_manager.cc.

References GitRevParseHead().

Referenced by yaze::editor::ProjectManagementPanel::DrawVersionControl().

Here is the call graph for this function:

◆ GetHistory()

std::vector< std::string > yaze::core::VersionManager::GetHistory ( int limit = 10) const

Definition at line 95 of file version_manager.cc.

References RunCommandOutput().

Referenced by yaze::editor::ProjectManagementPanel::DrawSnapshotHistory().

Here is the call graph for this function:

◆ GitInit()

absl::Status yaze::core::VersionManager::GitInit ( )
private

Definition at line 114 of file version_manager.cc.

References RunCommand().

Referenced by InitializeGit().

Here is the call graph for this function:

◆ GitAddAll()

absl::Status yaze::core::VersionManager::GitAddAll ( )
private

Definition at line 118 of file version_manager.cc.

References RunCommand().

Referenced by CreateSnapshot().

Here is the call graph for this function:

◆ GitCommit()

absl::Status yaze::core::VersionManager::GitCommit ( const std::string & message)
private

Definition at line 124 of file version_manager.cc.

References RunCommand().

Referenced by CreateSnapshot().

Here is the call graph for this function:

◆ GitRevParseHead()

std::string yaze::core::VersionManager::GitRevParseHead ( ) const
private

Definition at line 132 of file version_manager.cc.

References RunCommandOutput().

Referenced by CreateSnapshot(), and GetCurrentHash().

Here is the call graph for this function:

◆ BackupRomArtifact()

absl::Status yaze::core::VersionManager::BackupRomArtifact ( const std::string & timestamp_str)
private

◆ RunCommand()

absl::Status yaze::core::VersionManager::RunCommand ( const std::string & cmd)
private

Definition at line 184 of file version_manager.cc.

References yaze::project::YazeProject::filepath, and project_.

Referenced by GitAddAll(), GitCommit(), and GitInit().

◆ RunCommandOutput()

absl::StatusOr< std::string > yaze::core::VersionManager::RunCommandOutput ( const std::string & cmd) const
private

Definition at line 202 of file version_manager.cc.

References yaze::project::YazeProject::filepath, and project_.

Referenced by GetHistory(), and GitRevParseHead().

Member Data Documentation

◆ project_

project::YazeProject* yaze::core::VersionManager::project_
private

The documentation for this class was generated from the following files: