KiCad PCB EDA Suite
Loading...
Searching...
No Matches
local_history.cpp File Reference
#include <local_history.h>
#include <dialogs/dialog_restore_local_history.h>
#include <history_lock.h>
#include <io/kicad/kicad_io_utils.h>
#include <lockfile.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <pgm_base.h>
#include <thread_pool.h>
#include <trace_helpers.h>
#include <wildcards_and_files_ext.h>
#include <confirm.h>
#include <progress_reporter.h>
#include <git2.h>
#include <wx/filename.h>
#include <wx/filefn.h>
#include <wx/ffile.h>
#include <wx/dir.h>
#include <wx/datetime.h>
#include <wx/log.h>
#include <wx/msgdlg.h>
#include <vector>
#include <string>
#include <memory>
#include <algorithm>
#include <set>
#include <map>
#include <functional>
#include <cstring>

Go to the source code of this file.

Enumerations

enum class  SNAPSHOT_COMMIT_RESULT { Error , NoChanges , Committed }
 

Functions

static wxString historyPath (const wxString &aProjectPath)
 
static SNAPSHOT_COMMIT_RESULT commitSnapshotWithLock (git_repository *repo, git_index *index, const wxString &aHistoryPath, const wxString &aProjectPath, const std::vector< wxString > &aFiles, const wxString &aTitle)
 
static void collectProjectFiles (const wxString &aProjectPath, std::vector< wxString > &aFiles)
 
static size_t dirSizeRecursive (const wxString &path)
 
static bool copyTreeObjects (git_repository *aSrcRepo, git_odb *aSrcOdb, git_odb *aDstOdb, const git_oid *aTreeOid, std::set< git_oid, bool(*)(const git_oid &, const git_oid &)> &aCopied)
 
static bool compactRepository (git_repository *aRepo, PROGRESS_REPORTER *aReporter=nullptr)
 

Enumeration Type Documentation

◆ SNAPSHOT_COMMIT_RESULT

enum class SNAPSHOT_COMMIT_RESULT
strong
Enumerator
Error 
NoChanges 
Committed 

Definition at line 506 of file local_history.cpp.

Function Documentation

◆ collectProjectFiles()

static void collectProjectFiles ( const wxString & aProjectPath,
std::vector< wxString > & aFiles )
static

Definition at line 682 of file local_history.cpp.

References name, and path.

Referenced by LOCAL_HISTORY::CommitFullProjectSnapshot(), and LOCAL_HISTORY::RestoreCommit().

◆ commitSnapshotWithLock()

static SNAPSHOT_COMMIT_RESULT commitSnapshotWithLock ( git_repository * repo,
git_index * index,
const wxString & aHistoryPath,
const wxString & aProjectPath,
const std::vector< wxString > & aFiles,
const wxString & aTitle )
static

◆ compactRepository()

static bool compactRepository ( git_repository * aRepo,
PROGRESS_REPORTER * aReporter = nullptr )
static

Definition at line 1026 of file local_history.cpp.

References name, and PROGRESS_REPORTER::SetCurrentProgress().

Referenced by LOCAL_HISTORY::EnforceSizeLimit().

◆ copyTreeObjects()

static bool copyTreeObjects ( git_repository * aSrcRepo,
git_odb * aSrcOdb,
git_odb * aDstOdb,
const git_oid * aTreeOid,
std::set< git_oid, bool(* aCopied )(const git_oid &, const git_oid &)> & )
static

Definition at line 952 of file local_history.cpp.

References copyTreeObjects().

Referenced by copyTreeObjects(), and LOCAL_HISTORY::EnforceSizeLimit().

◆ dirSizeRecursive()

static size_t dirSizeRecursive ( const wxString & path)
static

Definition at line 929 of file local_history.cpp.

References dirSizeRecursive(), name, and path.

Referenced by dirSizeRecursive(), and LOCAL_HISTORY::EnforceSizeLimit().

◆ historyPath()

static wxString historyPath ( const wxString & aProjectPath)
static

Definition at line 56 of file local_history.cpp.