| 157 | } |
| 158 | |
| 159 | void VcsStatus::onMapEvent(IMap::MapEvent ev) |
| 160 | { |
| 161 | if (ev == IMap::MapSaved || ev == IMap::MapLoaded) |
| 162 | { |
| 163 | updateMapFileStatus(); |
| 164 | |
| 165 | if (_repository) |
| 166 | { |
| 167 | analyseRemoteStatus(_repository); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | // Only when saving: check whether a merge is to be completed |
| 172 | if (ev == IMap::MapSaved && _repository && _repository->mergeIsInProgress()) |
| 173 | { |
| 174 | auto mapPath = _repository->getRepositoryRelativePath(GlobalMapModule().getMapName()); |
| 175 | auto index = _repository->getIndex(); |
| 176 | |
| 177 | // Remove the conflict state of the map file after save |
| 178 | resolveMapFileConflictUsingOurs(_repository); |
| 179 | |
| 180 | if (wxutil::Messagebox::Show(_("Complete Merge Operation?"), |
| 181 | _("Map has been saved. Do you want to complete the ongoing merge operation using this state?"), |
| 182 | ::ui::IDialog::MessageType::MESSAGE_ASK) == ::ui::IDialog::RESULT_YES) |
| 183 | { |
| 184 | try |
| 185 | { |
| 186 | tryToFinishMerge(_repository); |
| 187 | } |
| 188 | catch (git::GitException& ex) |
| 189 | { |
| 190 | wxutil::Messagebox::ShowError(ex.what()); |
| 191 | } |
| 192 | |
| 193 | analyseRemoteStatus(_repository); |
| 194 | return; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | if (ev == IMap::MapMergeOperationAborted && _repository && _repository->mergeIsInProgress()) |
| 199 | { |
| 200 | // Ask the user whether to cancel the git merge status |
| 201 | if (wxutil::Messagebox::Show(_("Cancel Merge Operation?"), |
| 202 | _("You've aborted the map merge. Do you want to abort the ongoing git merge operation too?\n" |
| 203 | "This will perform a hard reset in the repository to the state it had before the merge was started.\n\n" |
| 204 | "Important: All uncommitted changes in the working tree will be lost!"), |
| 205 | ::ui::IDialog::MessageType::MESSAGE_ASK) == ::ui::IDialog::RESULT_YES) |
| 206 | { |
| 207 | try |
| 208 | { |
| 209 | _repository->abortMerge(); |
| 210 | } |
| 211 | catch (git::GitException& ex) |
| 212 | { |
| 213 | wxutil::Messagebox::ShowError(ex.what()); |
| 214 | } |
| 215 | |
| 216 | analyseRemoteStatus(_repository); |
nothing calls this directly
no test coverage detected