comparison src/org/tmatesoft/hg/core/HgCommitCommand.java @ 591:e447384f3771

CommitFacility as internal class; refactored infrastructure around internals (access to RevlogStream)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 30 Apr 2013 18:55:42 +0200
parents 73c20c648c1f
children 65c01508f002
comparison
equal deleted inserted replaced
590:8cbc2a883d95 591:e447384f3771
21 import java.io.IOException; 21 import java.io.IOException;
22 import java.nio.ByteBuffer; 22 import java.nio.ByteBuffer;
23 import java.util.ArrayList; 23 import java.util.ArrayList;
24 24
25 import org.tmatesoft.hg.internal.ByteArrayChannel; 25 import org.tmatesoft.hg.internal.ByteArrayChannel;
26 import org.tmatesoft.hg.internal.CommitFacility;
26 import org.tmatesoft.hg.internal.Experimental; 27 import org.tmatesoft.hg.internal.Experimental;
27 import org.tmatesoft.hg.internal.FileContentSupplier; 28 import org.tmatesoft.hg.internal.FileContentSupplier;
28 import org.tmatesoft.hg.repo.CommitFacility; 29 import org.tmatesoft.hg.internal.Internals;
29 import org.tmatesoft.hg.repo.HgChangelog; 30 import org.tmatesoft.hg.repo.HgChangelog;
30 import org.tmatesoft.hg.repo.HgDataFile; 31 import org.tmatesoft.hg.repo.HgDataFile;
31 import org.tmatesoft.hg.repo.HgInternals; 32 import org.tmatesoft.hg.repo.HgInternals;
32 import org.tmatesoft.hg.repo.HgRepository; 33 import org.tmatesoft.hg.repo.HgRepository;
33 import org.tmatesoft.hg.repo.HgRuntimeException; 34 import org.tmatesoft.hg.repo.HgRuntimeException;
102 Record status = sc.status(HgRepository.WORKING_COPY); 103 Record status = sc.status(HgRepository.WORKING_COPY);
103 if (status.getModified().size() == 0 && status.getAdded().size() == 0 && status.getRemoved().size() == 0) { 104 if (status.getModified().size() == 0 && status.getAdded().size() == 0 && status.getRemoved().size() == 0) {
104 newRevision = Nodeid.NULL; 105 newRevision = Nodeid.NULL;
105 return new Outcome(Kind.Failure, "nothing to add"); 106 return new Outcome(Kind.Failure, "nothing to add");
106 } 107 }
107 CommitFacility cf = new CommitFacility(repo, parentRevs[0], parentRevs[1]); 108 CommitFacility cf = new CommitFacility(Internals.getInstance(repo), parentRevs[0], parentRevs[1]);
108 for (Path m : status.getModified()) { 109 for (Path m : status.getModified()) {
109 HgDataFile df = repo.getFileNode(m); 110 HgDataFile df = repo.getFileNode(m);
110 cf.add(df, new WorkingCopyContent(df)); 111 cf.add(df, new WorkingCopyContent(df));
111 } 112 }
112 ArrayList<FileContentSupplier> toClear = new ArrayList<FileContentSupplier>(); 113 ArrayList<FileContentSupplier> toClear = new ArrayList<FileContentSupplier>();