39 static bool Init(
const wxString& aProjectPath );
42 static bool CommitSnapshot(
const std::vector<wxString>& aFiles,
const wxString& aTitle );
54 static void RegisterSaver(
const std::function<
void(
const wxString&, std::vector<wxString>& )>& aSaver );
68 static bool TagSave(
const wxString& aProjectPath,
const wxString& aFileType );
73 const wxString& aMessage );
77 static bool EnforceSizeLimit(
const wxString& aProjectPath,
size_t aMaxBytes );
83 static wxString
GetHeadHash(
const wxString& aProjectPath );
86 static bool RestoreCommit(
const wxString& aProjectPath,
const wxString& aHash );
Simple local history manager built on libgit2.
static bool TagSave(const wxString &aProjectPath, const wxString &aFileType)
Tag a manual save in the local history repository.
static wxString GetHeadHash(const wxString &aProjectPath)
Return the current head commit hash.
static void ShowRestoreDialog(const wxString &aProjectPath, wxWindow *aParent)
Show a dialog allowing the user to choose a snapshot to restore.
static bool HeadNewerThanLastSave(const wxString &aProjectPath)
Return true if the autosave data is newer than the last manual save.
static bool CommitDuplicateOfLastSave(const wxString &aProjectPath, const wxString &aFileType, const wxString &aMessage)
Create a new commit duplicating the tree pointed to by Last_Save_<fileType> and move the Last_Save_<f...
static bool EnforceSizeLimit(const wxString &aProjectPath, size_t aMaxBytes)
Enforce total size limit by rebuilding trimmed history keeping newest commits whose cumulative unique...
static bool Init(const wxString &aProjectPath)
Initialize the local history repository for the given project path.
static bool CommitSnapshot(const std::vector< wxString > &aFiles, const wxString &aTitle)
Commit the given files to the local history repository.
static bool RunRegisteredSaversAndCommit(const wxString &aProjectPath, const wxString &aTitle)
Run all registered savers and, if any staged changes differ from HEAD, create a commit.
static void NoteFileChange(const wxString &aFile)
Record that a file has been modified and should be included in the next snapshot.
static bool CommitPending()
Commit any pending modified files to the history repository.
static bool HistoryExists(const wxString &aProjectPath)
Return true if history exists for the project.
static bool CommitFullProjectSnapshot(const wxString &aProjectPath, const wxString &aTitle)
Commit a snapshot of the entire project directory (excluding the .history directory and ignored trans...
static bool RestoreCommit(const wxString &aProjectPath, const wxString &aHash)
Restore the project files to the state recorded by the given commit hash.
static void RegisterSaver(const std::function< void(const wxString &, std::vector< wxString > &)> &aSaver)
Register a saver callback invoked during autosave history commits.