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 ()
 
bool AdoptExistingRepository ()
 
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

std::filesystem::path RepositoryRoot () const
 
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::YazeProject * project_
 

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 30 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 56 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:

◆ AdoptExistingRepository()

bool yaze::core::VersionManager::AdoptExistingRepository ( )

◆ CreateSnapshot()

◆ IsGitInitialized()

bool yaze::core::VersionManager::IsGitInitialized ( ) const

◆ GetCurrentHash()

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

Definition at line 125 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 129 of file version_manager.cc.

References RunCommandOutput().

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

Here is the call graph for this function:

◆ RepositoryRoot()

fs::path yaze::core::VersionManager::RepositoryRoot ( ) const
private

◆ GitInit()

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

Definition at line 151 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 155 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 161 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 169 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 227 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 252 of file version_manager.cc.

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

Referenced by GetHistory(), and GitRevParseHead().

Member Data Documentation

◆ project_


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