Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 506:27398bbfd543
Experiment to add a facility to check working files for actual changes
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 30 Nov 2012 22:52:39 +0100 |
parents | d2f6ab541330 |
children | a6435c1a42d0 |
comparison
equal
deleted
inserted
replaced
505:3cd3c3d37432 | 506:27398bbfd543 |
---|---|
14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.console; | 17 package org.tmatesoft.hg.console; |
18 | 18 |
19 import static org.junit.Assert.*; | |
20 import static org.tmatesoft.hg.repo.HgRepository.TIP; | 19 import static org.tmatesoft.hg.repo.HgRepository.TIP; |
21 import static org.tmatesoft.hg.repo.HgRepository.WORKING_COPY; | 20 import static org.tmatesoft.hg.repo.HgRepository.WORKING_COPY; |
22 import static org.tmatesoft.hg.util.LogFacility.Severity.*; | 21 import static org.tmatesoft.hg.util.LogFacility.Severity.*; |
23 | 22 |
24 import java.io.File; | 23 import java.io.File; |
25 import java.io.IOException; | |
26 import java.util.ArrayList; | 24 import java.util.ArrayList; |
27 import java.util.Collection; | |
28 import java.util.Collections; | 25 import java.util.Collections; |
29 import java.util.HashSet; | 26 import java.util.HashSet; |
30 import java.util.List; | 27 import java.util.List; |
31 import java.util.Map; | 28 import java.util.Map; |
32 import java.util.regex.Pattern; | 29 |
33 | |
34 import org.tmatesoft.hg.core.HgManifestHandler; | |
35 import org.tmatesoft.hg.core.HgCallbackTargetException; | |
36 import org.tmatesoft.hg.core.HgCatCommand; | |
37 import org.tmatesoft.hg.core.HgChangeset; | 30 import org.tmatesoft.hg.core.HgChangeset; |
38 import org.tmatesoft.hg.core.HgChangesetFileSneaker; | |
39 import org.tmatesoft.hg.core.HgChangesetTreeHandler; | 31 import org.tmatesoft.hg.core.HgChangesetTreeHandler; |
40 import org.tmatesoft.hg.core.HgException; | 32 import org.tmatesoft.hg.core.HgException; |
41 import org.tmatesoft.hg.core.HgFileRevision; | 33 import org.tmatesoft.hg.core.HgFileRevision; |
42 import org.tmatesoft.hg.core.HgLogCommand; | 34 import org.tmatesoft.hg.core.HgLogCommand; |
43 import org.tmatesoft.hg.core.HgManifestCommand; | 35 import org.tmatesoft.hg.core.HgManifestCommand; |
36 import org.tmatesoft.hg.core.HgManifestHandler; | |
44 import org.tmatesoft.hg.core.Nodeid; | 37 import org.tmatesoft.hg.core.Nodeid; |
45 import org.tmatesoft.hg.internal.BasicSessionContext; | 38 import org.tmatesoft.hg.internal.BasicSessionContext; |
46 import org.tmatesoft.hg.internal.ByteArrayChannel; | 39 import org.tmatesoft.hg.internal.ByteArrayChannel; |
47 import org.tmatesoft.hg.internal.ConfigFile; | 40 import org.tmatesoft.hg.internal.ConfigFile; |
48 import org.tmatesoft.hg.internal.DigestHelper; | 41 import org.tmatesoft.hg.internal.DigestHelper; |
49 import org.tmatesoft.hg.internal.IntMap; | |
50 import org.tmatesoft.hg.internal.Internals; | |
51 import org.tmatesoft.hg.internal.PathGlobMatcher; | 42 import org.tmatesoft.hg.internal.PathGlobMatcher; |
52 import org.tmatesoft.hg.internal.PhasesHelper; | |
53 import org.tmatesoft.hg.internal.RelativePathRewrite; | 43 import org.tmatesoft.hg.internal.RelativePathRewrite; |
54 import org.tmatesoft.hg.internal.RevisionDescendants; | |
55 import org.tmatesoft.hg.internal.StreamLogFacility; | 44 import org.tmatesoft.hg.internal.StreamLogFacility; |
56 import org.tmatesoft.hg.repo.HgBookmarks; | 45 import org.tmatesoft.hg.repo.HgBookmarks; |
57 import org.tmatesoft.hg.repo.HgBranches; | 46 import org.tmatesoft.hg.repo.HgBranches; |
58 import org.tmatesoft.hg.repo.HgChangelog; | 47 import org.tmatesoft.hg.repo.HgChangelog; |
59 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 48 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
64 import org.tmatesoft.hg.repo.HgIgnore; | 53 import org.tmatesoft.hg.repo.HgIgnore; |
65 import org.tmatesoft.hg.repo.HgInternals; | 54 import org.tmatesoft.hg.repo.HgInternals; |
66 import org.tmatesoft.hg.repo.HgManifest; | 55 import org.tmatesoft.hg.repo.HgManifest; |
67 import org.tmatesoft.hg.repo.HgManifest.Flags; | 56 import org.tmatesoft.hg.repo.HgManifest.Flags; |
68 import org.tmatesoft.hg.repo.HgMergeState; | 57 import org.tmatesoft.hg.repo.HgMergeState; |
69 import org.tmatesoft.hg.repo.HgParentChildMap; | |
70 import org.tmatesoft.hg.repo.HgPhase; | |
71 import org.tmatesoft.hg.repo.HgRepository; | 58 import org.tmatesoft.hg.repo.HgRepository; |
59 import org.tmatesoft.hg.repo.HgRevisionMap; | |
72 import org.tmatesoft.hg.repo.HgRuntimeException; | 60 import org.tmatesoft.hg.repo.HgRuntimeException; |
73 import org.tmatesoft.hg.repo.HgStatusCollector; | 61 import org.tmatesoft.hg.repo.HgStatusCollector; |
74 import org.tmatesoft.hg.repo.HgStatusInspector; | 62 import org.tmatesoft.hg.repo.HgStatusInspector; |
75 import org.tmatesoft.hg.repo.HgSubrepoLocation; | 63 import org.tmatesoft.hg.repo.HgSubrepoLocation; |
76 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; | 64 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; |
65 import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; | |
77 import org.tmatesoft.hg.repo.ext.HgExtensionsManager; | 66 import org.tmatesoft.hg.repo.ext.HgExtensionsManager; |
78 import org.tmatesoft.hg.repo.ext.HgExtensionsManager.HgExt; | 67 import org.tmatesoft.hg.repo.ext.HgExtensionsManager.HgExt; |
79 import org.tmatesoft.hg.repo.ext.MqManager; | |
80 import org.tmatesoft.hg.repo.ext.Rebase; | 68 import org.tmatesoft.hg.repo.ext.Rebase; |
81 import org.tmatesoft.hg.repo.ext.MqManager.PatchRecord; | |
82 import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; | |
83 import org.tmatesoft.hg.repo.HgRevisionMap; | |
84 import org.tmatesoft.hg.test.ExecHelper; | |
85 import org.tmatesoft.hg.test.OutputParser; | |
86 import org.tmatesoft.hg.util.FileWalker; | 69 import org.tmatesoft.hg.util.FileWalker; |
87 import org.tmatesoft.hg.util.LogFacility; | 70 import org.tmatesoft.hg.util.LogFacility; |
88 import org.tmatesoft.hg.util.Pair; | 71 import org.tmatesoft.hg.util.Pair; |
89 import org.tmatesoft.hg.util.Path; | 72 import org.tmatesoft.hg.util.Path; |
90 import org.tmatesoft.hg.util.PathRewrite; | 73 import org.tmatesoft.hg.util.PathRewrite; |
91 import org.tmatesoft.hg.util.ProgressSupport; | |
92 import org.tmatesoft.hg.util.LogFacility.Severity; | |
93 | 74 |
94 /** | 75 /** |
95 * Various debug dumps. | 76 * Various debug dumps. |
96 * | 77 * |
97 * @author Artem Tikhomirov | 78 * @author Artem Tikhomirov |
157 | 138 |
158 // TODO as test | 139 // TODO as test |
159 private void dumpBookmarks() throws Exception { | 140 private void dumpBookmarks() throws Exception { |
160 HgBookmarks bm = hgRepo.getBookmarks(); | 141 HgBookmarks bm = hgRepo.getBookmarks(); |
161 String active = bm.getActiveBookmarkName(); | 142 String active = bm.getActiveBookmarkName(); |
162 ArrayList<String> all = new ArrayList(bm.getAllBookmarks()); | 143 ArrayList<String> all = new ArrayList<String>(bm.getAllBookmarks()); |
163 Collections.sort(all); | 144 Collections.sort(all); |
164 for (String bmname : all) { | 145 for (String bmname : all) { |
165 if (bmname.equals(active)) { | 146 if (bmname.equals(active)) { |
166 System.out.print(" * "); | 147 System.out.print(" * "); |
167 } else { | 148 } else { |