Support copy and renamed modifications for hg

This commit is contained in:
René Pfeuffer
2020-05-18 13:55:59 +02:00
parent dfb8a60cc4
commit 31ffed43b7
2 changed files with 6 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Handle obscure line breaks in diff viewer ([#1129](https://github.com/scm-manager/scm-manager/pull/1129))
- Validate subversion client checksum ([#1113](https://github.com/scm-manager/scm-manager/issues/1113))
- Fix plugin manage permission ([#1135](https://github.com/scm-manager/scm-manager/pull/1135))
- Missing copy on write in the data store ([#1155](https://github.com/scm-manager/scm-manager/pull/1155))
## [2.0.0-rc7] - 2020-04-09
### Added

View File

@@ -84,7 +84,10 @@ public class JAXBDataStore<T> extends FileBasedStore<T> implements DataStore<T>
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(item, file);
CopyOnWrite.withTemporaryFile(
temp -> marshaller.marshal(item, temp.toFile()),
file.toPath()
);
}
catch (JAXBException ex) {
throw new StoreException("could not write object with id ".concat(id),