Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/RevlogStream.java @ 617:65c01508f002
Rollback support for commands that modify repository. Strategy to keep complete copy of a file being changed
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 15 May 2013 20:10:09 +0200 |
| parents | e1b29756f901 |
| children | 99ad1e3a4e4d |
comparison
equal
deleted
inserted
replaced
| 616:5e0313485eef | 617:65c01508f002 |
|---|---|
| 27 import java.lang.ref.SoftReference; | 27 import java.lang.ref.SoftReference; |
| 28 import java.util.ArrayList; | 28 import java.util.ArrayList; |
| 29 import java.util.List; | 29 import java.util.List; |
| 30 import java.util.zip.Inflater; | 30 import java.util.zip.Inflater; |
| 31 | 31 |
| 32 import org.tmatesoft.hg.core.HgIOException; | |
| 32 import org.tmatesoft.hg.core.Nodeid; | 33 import org.tmatesoft.hg.core.Nodeid; |
| 33 import org.tmatesoft.hg.repo.HgInternals; | 34 import org.tmatesoft.hg.repo.HgInternals; |
| 34 import org.tmatesoft.hg.repo.HgInvalidControlFileException; | 35 import org.tmatesoft.hg.repo.HgInvalidControlFileException; |
| 35 import org.tmatesoft.hg.repo.HgInvalidRevisionException; | 36 import org.tmatesoft.hg.repo.HgInvalidRevisionException; |
| 36 import org.tmatesoft.hg.repo.HgInvalidStateException; | 37 import org.tmatesoft.hg.repo.HgInvalidStateException; |
| 99 /*package*/ DataAccess getDataStream() { | 100 /*package*/ DataAccess getDataStream() { |
| 100 DataAccessProvider dataAccess = repo.getDataAccess(); | 101 DataAccessProvider dataAccess = repo.getDataAccess(); |
| 101 return dataAccess.createReader(getDataFile(), false); | 102 return dataAccess.createReader(getDataFile(), false); |
| 102 } | 103 } |
| 103 | 104 |
| 104 /*package*/ DataSerializer getIndexStreamWriter() { | 105 /*package*/ DataSerializer getIndexStreamWriter(Transaction tr) throws HgIOException { |
| 105 DataAccessProvider dataAccess = repo.getDataAccess(); | 106 DataAccessProvider dataAccess = repo.getDataAccess(); |
| 106 return dataAccess.createWriter(indexFile, true); | 107 return dataAccess.createWriter(tr, indexFile, true); |
| 107 } | 108 } |
| 108 | 109 |
| 109 /*package*/ DataSerializer getDataStreamWriter() { | 110 /*package*/ DataSerializer getDataStreamWriter(Transaction tr) throws HgIOException { |
| 110 DataAccessProvider dataAccess = repo.getDataAccess(); | 111 DataAccessProvider dataAccess = repo.getDataAccess(); |
| 111 return dataAccess.createWriter(getDataFile(), true); | 112 return dataAccess.createWriter(tr, getDataFile(), true); |
| 112 } | 113 } |
| 113 | 114 |
| 114 /** | 115 /** |
| 115 * Constructs file object that corresponds to .d revlog counterpart. | 116 * Constructs file object that corresponds to .d revlog counterpart. |
| 116 * Note, it's caller responsibility to ensure this file makes any sense (i.e. check {@link #inline} attribute) | 117 * Note, it's caller responsibility to ensure this file makes any sense (i.e. check {@link #inline} attribute) |
