Mercurial > jhg
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 484:ae4d6604debd
Bookmarks support added
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 08 Aug 2012 14:41:44 +0200 |
parents | e31e85cf4d4c |
children | b3c16d1aede0 |
comparison
equal
deleted
inserted
replaced
483:e31e85cf4d4c | 484:ae4d6604debd |
---|---|
51 import org.tmatesoft.hg.internal.PathGlobMatcher; | 51 import org.tmatesoft.hg.internal.PathGlobMatcher; |
52 import org.tmatesoft.hg.internal.PhasesHelper; | 52 import org.tmatesoft.hg.internal.PhasesHelper; |
53 import org.tmatesoft.hg.internal.RelativePathRewrite; | 53 import org.tmatesoft.hg.internal.RelativePathRewrite; |
54 import org.tmatesoft.hg.internal.RevisionDescendants; | 54 import org.tmatesoft.hg.internal.RevisionDescendants; |
55 import org.tmatesoft.hg.internal.StreamLogFacility; | 55 import org.tmatesoft.hg.internal.StreamLogFacility; |
56 import org.tmatesoft.hg.repo.HgBookmarks; | |
56 import org.tmatesoft.hg.repo.HgBranches; | 57 import org.tmatesoft.hg.repo.HgBranches; |
57 import org.tmatesoft.hg.repo.HgChangelog; | 58 import org.tmatesoft.hg.repo.HgChangelog; |
58 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 59 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
59 import org.tmatesoft.hg.repo.HgDataFile; | 60 import org.tmatesoft.hg.repo.HgDataFile; |
60 import org.tmatesoft.hg.repo.HgDirstate; | 61 import org.tmatesoft.hg.repo.HgDirstate; |
109 System.out.println("REPO:" + hgRepo.getLocation()); | 110 System.out.println("REPO:" + hgRepo.getLocation()); |
110 } | 111 } |
111 | 112 |
112 public static void main(String[] args) throws Exception { | 113 public static void main(String[] args) throws Exception { |
113 Main m = new Main(args); | 114 Main m = new Main(args); |
114 m.readConfigFile(); | 115 m.dumpBookmarks(); |
116 // m.readConfigFile(); | |
115 // m.dumpCommitLastMessage(); | 117 // m.dumpCommitLastMessage(); |
116 // m.buildFileLog(); | 118 // m.buildFileLog(); |
117 // m.testConsoleLog(); | 119 // m.testConsoleLog(); |
118 // m.testTreeTraversal(); | 120 // m.testTreeTraversal(); |
119 // m.testRevisionMap(); | 121 // m.testRevisionMap(); |
130 // m.testStatusInternals(); | 132 // m.testStatusInternals(); |
131 // m.catCompleteHistory(); | 133 // m.catCompleteHistory(); |
132 // m.dumpCompleteManifestLow(); | 134 // m.dumpCompleteManifestLow(); |
133 // m.dumpCompleteManifestHigh(); | 135 // m.dumpCompleteManifestHigh(); |
134 // m.bunchOfTests(); | 136 // m.bunchOfTests(); |
137 } | |
138 | |
139 // TODO as test | |
140 private void dumpBookmarks() throws Exception { | |
141 HgBookmarks bm = hgRepo.getBookmarks(); | |
142 String active = bm.getActiveBookmarkName(); | |
143 ArrayList<String> all = new ArrayList(bm.getAllBookmarks()); | |
144 Collections.sort(all); | |
145 for (String bmname : all) { | |
146 if (bmname.equals(active)) { | |
147 System.out.print(" * "); | |
148 } else { | |
149 System.out.print(" "); | |
150 } | |
151 System.out.printf("%-26s (%s)\n", bmname, bm.getRevision(bmname).shortNotation()); | |
152 } | |
135 } | 153 } |
136 | 154 |
137 // TODO as test | 155 // TODO as test |
138 private void readConfigFile() throws Exception { | 156 private void readConfigFile() throws Exception { |
139 ConfigFile configFile = new ConfigFile(HgInternals.getContext(hgRepo)); | 157 ConfigFile configFile = new ConfigFile(HgInternals.getContext(hgRepo)); |