diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2017-09-01 18:13:30 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2017-09-02 00:56:08 +0300 |
commit | 98718305e414021d79f5749bc9c4265596dfe50a (patch) | |
tree | d6764bccfe082d3be20a3fa89f9164d363ead3f0 | |
parent | 8f61a48ed3084e5431a4e5af82925f92e10eb893 (diff) |
-rw-r--r-- | defines.hpp | 1 | ||||
-rw-r--r-- | storage/diff_scheme/diff_manager.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/defines.hpp b/defines.hpp index fcaa00f1d4..60bcb091b5 100644 --- a/defines.hpp +++ b/defines.hpp @@ -3,6 +3,7 @@ #define DATA_FILE_EXTENSION ".mwm" #define DATA_FILE_EXTENSION_TMP ".mwm.tmp" #define DIFF_FILE_EXTENSION ".mwmdiff" +#define DIFF_APPLYING_FILE_EXTENSION ".diff.applying" #define FONT_FILE_EXTENSION ".ttf" #define OSM2FEATURE_FILE_EXTENSION ".osm2ft" #define EXTENSION_TMP ".tmp" diff --git a/storage/diff_scheme/diff_manager.cpp b/storage/diff_scheme/diff_manager.cpp index 4358cda4f9..d6dfcb63df 100644 --- a/storage/diff_scheme/diff_manager.cpp +++ b/storage/diff_scheme/diff_manager.cpp @@ -72,7 +72,9 @@ void Manager::ApplyDiff(ApplyDiffParams && p, std::function<void(bool const resu string const oldMwmPath = p.m_oldMwmFile->GetPath(MapOptions::Map); string const newMwmPath = diffFile->GetPath(MapOptions::Map); - result = generator::mwm_diff::ApplyDiff(oldMwmPath, newMwmPath, diffPath); + string const diffApplyingInProgressPath = newMwmPath + DIFF_APPLYING_FILE_EXTENSION; + result = generator::mwm_diff::ApplyDiff(oldMwmPath, diffApplyingInProgressPath, diffPath) && + my::RenameFileX(diffApplyingInProgressPath, newMwmPath); } diffFile->DeleteFromDisk(MapOptions::Diff); |