Mercurial > jhg
diff src/org/tmatesoft/hg/core/HgCloneCommand.java @ 664:ae2d439fbed3
Utilize transaction when writing fncache. Better HgIOException
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 10 Jul 2013 19:33:51 +0200 |
parents | 4a0bab2c6da1 |
children | 545b1d4cc11d |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgCloneCommand.java Wed Jul 10 16:41:49 2013 +0200 +++ b/src/org/tmatesoft/hg/core/HgCloneCommand.java Wed Jul 10 19:33:51 2013 +0200 @@ -38,10 +38,10 @@ import org.tmatesoft.hg.internal.RepoInitializer; import org.tmatesoft.hg.internal.RevlogCompressor; import org.tmatesoft.hg.internal.RevlogStreamWriter; +import org.tmatesoft.hg.internal.Transaction; import org.tmatesoft.hg.repo.HgBundle; import org.tmatesoft.hg.repo.HgBundle.GroupElement; import org.tmatesoft.hg.repo.HgInvalidControlFileException; -import org.tmatesoft.hg.repo.HgInvalidFileException; import org.tmatesoft.hg.repo.HgInvalidStateException; import org.tmatesoft.hg.repo.HgLookup; import org.tmatesoft.hg.repo.HgRemoteRepository; @@ -126,8 +126,6 @@ completeChanges.inspectAll(mate); mate.checkFailure(); mate.complete(); - } catch (IOException ex) { - throw new HgInvalidFileException(getClass().getName(), ex); } finally { completeChanges.unlink(); progress.done(); @@ -189,8 +187,8 @@ fncacheFile = new FNCacheFile(Internals.getInstance(new HgLookup(ctx).detect(hgDir))); } - public void complete() throws IOException { - fncacheFile.write(); + public void complete() throws HgIOException { + fncacheFile.write(new Transaction.NoRollback()); } public void changelogStart() throws HgInvalidControlFileException {