comparison src/org/tmatesoft/hg/internal/CommitFacility.java @ 628:6526d8adbc0f

Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 22 May 2013 15:52:31 +0200
parents 4e6179bde4fc
children ffce73efa2c2
comparison
equal deleted inserted replaced
627:5153eb73b18d 628:6526d8adbc0f
38 import org.tmatesoft.hg.core.HgRepositoryLockException; 38 import org.tmatesoft.hg.core.HgRepositoryLockException;
39 import org.tmatesoft.hg.core.Nodeid; 39 import org.tmatesoft.hg.core.Nodeid;
40 import org.tmatesoft.hg.internal.DataSerializer.DataSource; 40 import org.tmatesoft.hg.internal.DataSerializer.DataSource;
41 import org.tmatesoft.hg.repo.HgChangelog; 41 import org.tmatesoft.hg.repo.HgChangelog;
42 import org.tmatesoft.hg.repo.HgDataFile; 42 import org.tmatesoft.hg.repo.HgDataFile;
43 import org.tmatesoft.hg.repo.HgRuntimeException;
43 import org.tmatesoft.hg.util.Pair; 44 import org.tmatesoft.hg.util.Pair;
44 import org.tmatesoft.hg.util.Path; 45 import org.tmatesoft.hg.util.Path;
45 46
46 /** 47 /**
47 * Name: CommitObject, FutureCommit or PendingCommit 48 * Name: CommitObject, FutureCommit or PendingCommit
95 user = userName; 96 user = userName;
96 } 97 }
97 98
98 // this method doesn't roll transaction back in case of failure, caller's responsibility 99 // this method doesn't roll transaction back in case of failure, caller's responsibility
99 // this method expects repository to be locked, if needed 100 // this method expects repository to be locked, if needed
100 public Nodeid commit(String message, Transaction transaction) throws HgIOException, HgRepositoryLockException { 101 public Nodeid commit(String message, Transaction transaction) throws HgIOException, HgRepositoryLockException, HgRuntimeException {
101 final HgChangelog clog = repo.getRepo().getChangelog(); 102 final HgChangelog clog = repo.getRepo().getChangelog();
102 final int clogRevisionIndex = clog.getRevisionCount(); 103 final int clogRevisionIndex = clog.getRevisionCount();
103 ManifestRevision c1Manifest = new ManifestRevision(null, null); 104 ManifestRevision c1Manifest = new ManifestRevision(null, null);
104 ManifestRevision c2Manifest = new ManifestRevision(null, null); 105 ManifestRevision c2Manifest = new ManifestRevision(null, null);
105 final Nodeid p1Cset = p1Commit == NO_REVISION ? null : clog.getRevision(p1Commit); 106 final Nodeid p1Cset = p1Commit == NO_REVISION ? null : clog.getRevision(p1Commit);