comparison src/org/tmatesoft/hg/core/HgCommitCommand.java @ 708:4ffc17c0b534

Merge: tests for resolver and complex scenario. Enable commit for merged revisions. Reuse file revisions if nothing changed
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 20 Aug 2013 18:41:34 +0200
parents b4242b7e7dfe
children
comparison
equal deleted inserted replaced
707:42b88709e41d 708:4ffc17c0b534
100 final CompleteRepoLock repoLock = new CompleteRepoLock(repo); 100 final CompleteRepoLock repoLock = new CompleteRepoLock(repo);
101 repoLock.acquire(); 101 repoLock.acquire();
102 try { 102 try {
103 int[] parentRevs = new int[2]; 103 int[] parentRevs = new int[2];
104 detectParentFromDirstate(parentRevs); 104 detectParentFromDirstate(parentRevs);
105 if (parentRevs[0] != NO_REVISION && parentRevs[1] != NO_REVISION) {
106 throw new HgBadArgumentException("Sorry, I'm not yet smart enough to perform merge commits", null);
107 }
108 HgWorkingCopyStatusCollector sc = new HgWorkingCopyStatusCollector(repo); 105 HgWorkingCopyStatusCollector sc = new HgWorkingCopyStatusCollector(repo);
109 Record status = sc.status(HgRepository.WORKING_COPY); 106 Record status = sc.status(HgRepository.WORKING_COPY);
110 if (status.getModified().size() == 0 && status.getAdded().size() == 0 && status.getRemoved().size() == 0) { 107 if (status.getModified().size() == 0 && status.getAdded().size() == 0 && status.getRemoved().size() == 0) {
111 newRevision = Nodeid.NULL; 108 newRevision = Nodeid.NULL;
112 return new Outcome(Kind.Failure, "nothing to add"); 109 return new Outcome(Kind.Failure, "nothing to add");