Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 526:2f9ed6bcefa2
Initial support for Revert command with accompanying minor refactoring
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 15 Jan 2013 17:07:19 +0100 |
parents | 0be5be8d57e9 |
children | 88afffd39899 |
comparison
equal
deleted
inserted
replaced
525:0be5be8d57e9 | 526:2f9ed6bcefa2 |
---|---|
34 import org.tmatesoft.hg.core.HgFileRenameHandlerMixin; | 34 import org.tmatesoft.hg.core.HgFileRenameHandlerMixin; |
35 import org.tmatesoft.hg.core.HgFileRevision; | 35 import org.tmatesoft.hg.core.HgFileRevision; |
36 import org.tmatesoft.hg.core.HgLogCommand; | 36 import org.tmatesoft.hg.core.HgLogCommand; |
37 import org.tmatesoft.hg.core.HgManifestCommand; | 37 import org.tmatesoft.hg.core.HgManifestCommand; |
38 import org.tmatesoft.hg.core.HgManifestHandler; | 38 import org.tmatesoft.hg.core.HgManifestHandler; |
39 import org.tmatesoft.hg.core.HgRevertCommand; | |
39 import org.tmatesoft.hg.core.Nodeid; | 40 import org.tmatesoft.hg.core.Nodeid; |
40 import org.tmatesoft.hg.internal.BasicSessionContext; | 41 import org.tmatesoft.hg.internal.BasicSessionContext; |
41 import org.tmatesoft.hg.internal.ByteArrayChannel; | 42 import org.tmatesoft.hg.internal.ByteArrayChannel; |
42 import org.tmatesoft.hg.internal.ConfigFile; | 43 import org.tmatesoft.hg.internal.ConfigFile; |
43 import org.tmatesoft.hg.internal.DigestHelper; | 44 import org.tmatesoft.hg.internal.DigestHelper; |
97 System.out.println("REPO:" + hgRepo.getLocation()); | 98 System.out.println("REPO:" + hgRepo.getLocation()); |
98 } | 99 } |
99 | 100 |
100 public static void main(String[] args) throws Exception { | 101 public static void main(String[] args) throws Exception { |
101 Main m = new Main(args); | 102 Main m = new Main(args); |
102 m.testCheckout(); | 103 m.testRevert(); |
104 // m.testCheckout(); | |
103 // m.tryExtensions(); | 105 // m.tryExtensions(); |
104 // m.dumpBookmarks(); | 106 // m.dumpBookmarks(); |
105 // m.readConfigFile(); | 107 // m.readConfigFile(); |
106 // m.dumpCommitLastMessage(); | 108 // m.dumpCommitLastMessage(); |
107 // m.buildFileLog(); | 109 // m.buildFileLog(); |
121 // m.testStatusInternals(); | 123 // m.testStatusInternals(); |
122 // m.catCompleteHistory(); | 124 // m.catCompleteHistory(); |
123 // m.dumpCompleteManifestLow(); | 125 // m.dumpCompleteManifestLow(); |
124 // m.dumpCompleteManifestHigh(); | 126 // m.dumpCompleteManifestHigh(); |
125 // m.bunchOfTests(); | 127 // m.bunchOfTests(); |
128 } | |
129 | |
130 private void testRevert() throws Exception { | |
131 HgRevertCommand cmd = new HgRevertCommand(hgRepo); | |
132 cmd.file(Path.create("a.txt")).execute(); | |
126 } | 133 } |
127 | 134 |
128 private void testCheckout() throws Exception { | 135 private void testCheckout() throws Exception { |
129 HgCheckoutCommand coCmd = new HgCheckoutCommand(hgRepo); | 136 HgCheckoutCommand coCmd = new HgCheckoutCommand(hgRepo); |
130 coCmd.changeset(17).execute(); | 137 coCmd.changeset(17).execute(); |