comparison src/org/tmatesoft/hg/internal/DirstateReader.java @ 534:243202f1bda5

Commit: refactor revision creation code from clone command to work separately, fit into existing library structure
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 04 Feb 2013 18:00:55 +0100
parents 47b7bedf0569
children 5daa42067e7c
comparison
equal deleted inserted replaced
533:e6f72c9829a6 534:243202f1bda5
64 parents = new Pair<Nodeid,Nodeid>(Nodeid.NULL, Nodeid.NULL); 64 parents = new Pair<Nodeid,Nodeid>(Nodeid.NULL, Nodeid.NULL);
65 File dirstateFile = getDirstateFile(repo); 65 File dirstateFile = getDirstateFile(repo);
66 if (dirstateFile == null || !dirstateFile.exists()) { 66 if (dirstateFile == null || !dirstateFile.exists()) {
67 return; 67 return;
68 } 68 }
69 DataAccess da = repo.getDataAccess().create(dirstateFile); 69 DataAccess da = repo.getDataAccess().createReader(dirstateFile);
70 try { 70 try {
71 if (da.isEmpty()) { 71 if (da.isEmpty()) {
72 return; 72 return;
73 } 73 }
74 parents = internalReadParents(da); 74 parents = internalReadParents(da);
140 // do not read whole dirstate if all we need is WC parent information 140 // do not read whole dirstate if all we need is WC parent information
141 File dirstateFile = getDirstateFile(internalRepo); 141 File dirstateFile = getDirstateFile(internalRepo);
142 if (dirstateFile == null || !dirstateFile.exists()) { 142 if (dirstateFile == null || !dirstateFile.exists()) {
143 return new Pair<Nodeid,Nodeid>(NULL, NULL); 143 return new Pair<Nodeid,Nodeid>(NULL, NULL);
144 } 144 }
145 DataAccess da = internalRepo.getDataAccess().create(dirstateFile); 145 DataAccess da = internalRepo.getDataAccess().createReader(dirstateFile);
146 try { 146 try {
147 if (da.isEmpty()) { 147 if (da.isEmpty()) {
148 return new Pair<Nodeid,Nodeid>(NULL, NULL); 148 return new Pair<Nodeid,Nodeid>(NULL, NULL);
149 } 149 }
150 return internalReadParents(da); 150 return internalReadParents(da);