From ce5d68ecd1b08b1c608fc15d55e9bf751e95f9df Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Wed, 29 Apr 2009 14:06:43 +0200 Subject: [PATCH] Make vng whatsnew not timeout on a large repo and code caches. Add tiny feature to GitRunner. Allow a custom timeout. --- src/GitRunner.cpp | 3 ++- src/GitRunner.h | 4 ++++ src/commands/Changes.cpp | 1 + src/commands/Record.cpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/GitRunner.cpp b/src/GitRunner.cpp index 9457d8f..c6ac0a3 100644 --- a/src/GitRunner.cpp +++ b/src/GitRunner.cpp @@ -22,7 +22,8 @@ GitRunner::GitRunner(QProcess &process, const QStringList &arguments) : m_process(&process), - m_arguments(arguments) + m_arguments(arguments), + m_timeout(30000) { } diff --git a/src/GitRunner.h b/src/GitRunner.h index 3d8f881..a4d2ac2 100644 --- a/src/GitRunner.h +++ b/src/GitRunner.h @@ -41,9 +41,13 @@ public: void setArguments(const QStringList &arguments); + void setTimeout(int msecs) { m_timeout = msecs; } + int timeout() const { return m_timeout; } + private: QProcess *m_process; QStringList m_arguments; + int m_timeout; }; #endif diff --git a/src/commands/Changes.cpp b/src/commands/Changes.cpp index dab7d91..8e75edb 100644 --- a/src/commands/Changes.cpp +++ b/src/commands/Changes.cpp @@ -114,6 +114,7 @@ AbstractCommand::ReturnCodes Changes::run() } GitRunner runner(git, arguments); + runner.setTimeout(-1); ReturnCodes rc = runner.start(GitRunner::WaitForStandardOutput); if (rc) { Logger::error() << "Vng failed: Unknown branch or revision: "; diff --git a/src/commands/Record.cpp b/src/commands/Record.cpp index 56e87bf..09f6a55 100644 --- a/src/commands/Record.cpp +++ b/src/commands/Record.cpp @@ -434,6 +434,7 @@ AbstractCommand::ReturnCodes Record::addFilesPerAcceptance(const ChangeSet &chan fileName = fileName + ".orig"; if (sourceFile.rename(fileName)) break; // successful! + } } reverter.append(fileName, file.fileName()); if (removeFromIndex) // need to rename it only, we won't patch it. -- 2.11.4.GIT