Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/AddRevInspector.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 | 46b56864b483 |
| children |
comparison
equal
deleted
inserted
replaced
| 663:46b56864b483 | 664:ae2d439fbed3 |
|---|---|
| 14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
| 16 */ | 16 */ |
| 17 package org.tmatesoft.hg.internal; | 17 package org.tmatesoft.hg.internal; |
| 18 | 18 |
| 19 import java.io.IOException; | |
| 20 import java.util.HashMap; | 19 import java.util.HashMap; |
| 21 import java.util.Set; | 20 import java.util.Set; |
| 22 | 21 |
| 23 import org.tmatesoft.hg.core.HgIOException; | 22 import org.tmatesoft.hg.core.HgIOException; |
| 24 import org.tmatesoft.hg.core.Nodeid; | 23 import org.tmatesoft.hg.core.Nodeid; |
| 48 private boolean newFile = false; | 47 private boolean newFile = false; |
| 49 | 48 |
| 50 public AddRevInspector(Internals implRepo, Transaction transaction) { | 49 public AddRevInspector(Internals implRepo, Transaction transaction) { |
| 51 repo = implRepo; | 50 repo = implRepo; |
| 52 tr = transaction; | 51 tr = transaction; |
| 53 fncache = new FNCacheFile.Mediator(implRepo); | 52 fncache = new FNCacheFile.Mediator(implRepo, transaction); |
| 54 } | 53 } |
| 55 | 54 |
| 56 public void changelogStart() throws HgRuntimeException { | 55 public void changelogStart() throws HgRuntimeException { |
| 57 RevlogStream rs = repo.getImplAccess().getChangelogStream(); | 56 RevlogStream rs = repo.getImplAccess().getChangelogStream(); |
| 58 revlog = new RevlogStreamWriter(repo, rs, tr); | 57 revlog = new RevlogStreamWriter(repo, rs, tr); |
| 112 | 111 |
| 113 public RevisionSet addedChangesets() { | 112 public RevisionSet addedChangesets() { |
| 114 return new RevisionSet(added); | 113 return new RevisionSet(added); |
| 115 } | 114 } |
| 116 | 115 |
| 117 public void done() throws IOException { | 116 public void done() throws HgIOException { |
| 118 fncache.complete(); | 117 fncache.complete(); |
| 119 } | 118 } |
| 120 | 119 |
| 121 private static class RevMap implements RevlogStreamWriter.RevisionToIndexMap { | 120 private static class RevMap implements RevlogStreamWriter.RevisionToIndexMap { |
| 122 | 121 |
