64 std::shared_ptr<RepositoryManager> repo_manager);
85 [[nodiscard]] std::string
getName()
const override;
107 [[nodiscard]] std::string
getUsage()
const override;
120 bool execute(
const std::vector<std::string>& args)
override;
143 void debugBranchHistory(
const std::string& branch_name,
const std::string& head_commit)
const;
156 bool mergeBranch(
const std::string& branch_name)
const;
167 bool abortMerge()
const;
178 [[nodiscard]]
bool isMergeInProgress()
const;
193 std::string findCommonAncestor(
const std::string& commit1,
const std::string& commit2)
const;
210 bool performThreeWayMerge(
const std::string& ancestor,
211 const std::string& current,
212 const std::string& other)
const;
231 static bool mergeFileContent(
const std::string& ancestor_content,
232 const std::string& current_content,
233 const std::string& other_content,
234 std::string& merged_content);
244 std::shared_ptr<ISubject> event_bus_;
253 std::shared_ptr<RepositoryManager> repo_manager_;
Declaration of the ICommand interface for all executable CLI commands.
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Declaration of the RepositoryManager class, managing all repository-level file operations.
Interface (abstract base class) for all commands executed via the CLI.
Definition ICommand.hxx:34
bool execute(const std::vector< std::string > &args) override
Executes the merge command with given arguments.
Definition MergeCommand.cxx:38
std::string getName() const override
Gets the command name.
Definition MergeCommand.cxx:26
std::string getDescription() const override
Gets the command description.
Definition MergeCommand.cxx:30
MergeCommand(std::shared_ptr< ISubject > event_bus, std::shared_ptr< RepositoryManager > repo_manager)
Constructs a MergeCommand with event bus and repository manager.
Definition MergeCommand.cxx:21
void showHelp() const override
Displays help information for the command.
Definition MergeCommand.cxx:74
~MergeCommand() override=default
Destructor.
std::string getUsage() const override
Gets the command usage syntax.
Definition MergeCommand.cxx:34
Command-line interface components and command implementations.
Core VCS data structures and object model.
Service layer components and infrastructure services.