annotate src/org/tmatesoft/hg/core/HgRepoFacade.java @ 648:690e71d29bf6

Introduced RevisionSet to ease update of phase roots on push
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 25 Jun 2013 20:48:37 +0200
parents 4a0bab2c6da1
children 12a4f60ea972
rev   line source
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
1 /*
566
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
2 * Copyright (c) 2011-2013 TMate Software Ltd
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
3 *
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
6 * the Free Software Foundation; version 2 of the License.
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
7 *
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
11 * GNU General Public License for more details.
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
12 *
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
13 * For information on how to redistribute this software under
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
14 * the terms of a license other than GNU General Public License
102
a3a2e5deb320 Updated contact address to support@hg4j.com
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 95
diff changeset
15 * contact TMate Software at support@hg4j.com
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
16 */
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
17 package org.tmatesoft.hg.core;
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
18
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
19 import java.io.File;
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
20
295
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
21 import org.tmatesoft.hg.internal.BasicSessionContext;
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
22 import org.tmatesoft.hg.repo.HgRepository;
95
bcd31a4c638a Lookup to HgLookup
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 74
diff changeset
23 import org.tmatesoft.hg.repo.HgLookup;
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
24
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
25 /**
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
26 * Starting point for the library.
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
27 * <p>Sample use:
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
28 * <pre>
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
29 * HgRepoFacade f = new HgRepoFacade();
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
30 * f.initFrom(System.getenv("whatever.repo.location"));
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
31 * HgStatusCommand statusCmd = f.createStatusCommand();
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
32 * HgStatusCommand.Handler handler = ...;
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
33 * statusCmd.execute(handler);
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
34 * </pre>
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
35 *
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
36 * @author Artem Tikhomirov
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
37 * @author TMate Software Ltd.
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
38 */
571
e4ee4bf4c7d0 Let session context control creation of Path instances
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 566
diff changeset
39 public class HgRepoFacade implements SessionContext.Source {
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
40 private HgRepository repo;
295
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
41 private final SessionContext context;
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
42
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
43 public HgRepoFacade() {
431
12f668401613 FIXMEs: awkward API refactored, what need to be internal got hidden; public aspects got captured in slim interfaces
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 423
diff changeset
44 this(new BasicSessionContext(null));
295
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
45 }
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
46
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
47 public HgRepoFacade(SessionContext ctx) {
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
48 if (ctx == null) {
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
49 throw new IllegalArgumentException();
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
50 }
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
51 context = ctx;
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
52 }
143
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
53
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
54 /**
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
55 * @param hgRepo
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
56 * @return true on successful initialization
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
57 * @throws IllegalArgumentException when argument is null
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
58 */
143
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
59 public boolean init(HgRepository hgRepo) {
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
60 if (hgRepo == null) {
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
61 throw new IllegalArgumentException();
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
62 }
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
63 repo = hgRepo;
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
64 return !repo.isInvalid();
b9700740553a Command line tools parse and respect most of command-line arguments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 131
diff changeset
65 }
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
66
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
67 /**
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
68 * Tries to find repository starting from the current working directory.
423
9c9c442b5f2e Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 295
diff changeset
69 *
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
70 * @return <code>true</code> if found valid repository
423
9c9c442b5f2e Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 295
diff changeset
71 * @throws HgRepositoryNotFoundException if no repository found in working directory
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
72 */
423
9c9c442b5f2e Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 295
diff changeset
73 public boolean init() throws HgRepositoryNotFoundException {
295
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
74 repo = new HgLookup(context).detectFromWorkingDir();
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
75 return repo != null && !repo.isInvalid();
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
76 }
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
77
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
78 /**
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
79 * Looks up Mercurial repository starting from specified location and up to filesystem root.
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
80 *
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
81 * @param repoLocation path to any folder within structure of a Mercurial repository.
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
82 * @return <code>true</code> if found valid repository
423
9c9c442b5f2e Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 295
diff changeset
83 * @throws HgRepositoryNotFoundException if there's no repository at specified location
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
84 * @throws IllegalArgumentException if argument is <code>null</code>
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
85 */
423
9c9c442b5f2e Major refactoring of exception handling. Low-level API uses RuntimeExceptions, while checked are left for higher level
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 295
diff changeset
86 public boolean initFrom(File repoLocation) throws HgRepositoryNotFoundException {
148
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
87 if (repoLocation == null) {
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
88 throw new IllegalArgumentException();
1a7a9a20e1f9 Exceptions, javadoc. Initial cancel and progress support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 143
diff changeset
89 }
295
981f9f50bb6c Issue 11: Error log facility. SessionContext to share common facilities
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 181
diff changeset
90 repo = new HgLookup(context).detect(repoLocation);
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
91 return repo != null && !repo.isInvalid();
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
92 }
115
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
93
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
94 public HgRepository getRepository() {
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
95 if (repo == null) {
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
96 throw new IllegalStateException("Call any of #init*() methods first first");
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
97 }
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
98 return repo;
c0cc2535462c Introduced channels to pipeline (and easily filter) data streams
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 108
diff changeset
99 }
571
e4ee4bf4c7d0 Let session context control creation of Path instances
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 566
diff changeset
100
e4ee4bf4c7d0 Let session context control creation of Path instances
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 566
diff changeset
101 public SessionContext getSessionContext() {
e4ee4bf4c7d0 Let session context control creation of Path instances
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 566
diff changeset
102 return context;
e4ee4bf4c7d0 Let session context control creation of Path instances
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 566
diff changeset
103 }
637
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
104
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
105 /**
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
106 * This factory method doesn't need this facade to be initialized with a repository.
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
107 * @return command instance, never <code>null</code>
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
108 */
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
109 public HgInitCommand createInitCommand() {
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
110 return new HgInitCommand(new HgLookup(context));
4a0bab2c6da1 HgInitCommand: expose repo init functionality
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 630
diff changeset
111 }
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
112
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
113 public HgLogCommand createLogCommand() {
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
114 return new HgLogCommand(repo/*, getCommandContext()*/);
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
115 }
108
0c9804857000 Embellishments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 102
diff changeset
116
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
117 public HgStatusCommand createStatusCommand() {
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
118 return new HgStatusCommand(repo/*, getCommandContext()*/);
108
0c9804857000 Embellishments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 102
diff changeset
119 }
0c9804857000 Embellishments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 102
diff changeset
120
131
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
121 public HgCatCommand createCatCommand() {
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
122 return new HgCatCommand(repo);
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
123 }
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
124
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
125 public HgManifestCommand createManifestCommand() {
aa1629f36482 Renamed .core classes to start with Hg prefix
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 115
diff changeset
126 return new HgManifestCommand(repo);
108
0c9804857000 Embellishments
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 102
diff changeset
127 }
181
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
128
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
129 public HgOutgoingCommand createOutgoingCommand() {
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
130 return new HgOutgoingCommand(repo);
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
131 }
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
132
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
133 public HgIncomingCommand createIncomingCommand() {
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
134 return new HgIncomingCommand(repo);
cd3371670f0b Refactor incoming and outgoing code to be shared with RepositoryComparator. Placeholders for in/out commands. Refactor common remote lookup code
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 148
diff changeset
135 }
566
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
136
586
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
137 public HgCloneCommand createCloneCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
138 return new HgCloneCommand();
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
139 }
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
140
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
141 public HgUpdateConfigCommand createUpdateRepositoryConfigCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
142 return HgUpdateConfigCommand.forRepository(repo);
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
143 }
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
144
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
145 public HgAddRemoveCommand createAddRemoveCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
146 return new HgAddRemoveCommand(repo);
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
147 }
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
148
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
149 public HgCheckoutCommand createCheckoutCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
150 return new HgCheckoutCommand(repo);
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
151 }
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
152
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
153 public HgRevertCommand createRevertCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
154 return new HgRevertCommand(repo);
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
155 }
566
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
156
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
157 public HgAnnotateCommand createAnnotateCommand() {
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
158 return new HgAnnotateCommand(repo);
32453f30de07 Annotate command with command-line example
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 431
diff changeset
159 }
586
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
160
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
161 public HgCommitCommand createCommitCommand() {
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
162 return new HgCommitCommand(repo);
73c20c648c1f HgCommitCommand initial support
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 571
diff changeset
163 }
630
72c979555cb8 HgDiffCommand. Do not use deprecated code. Javadoc
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 586
diff changeset
164
72c979555cb8 HgDiffCommand. Do not use deprecated code. Javadoc
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 586
diff changeset
165 public HgDiffCommand createDiffCommand() {
72c979555cb8 HgDiffCommand. Do not use deprecated code. Javadoc
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 586
diff changeset
166 return new HgDiffCommand(repo);
72c979555cb8 HgDiffCommand. Do not use deprecated code. Javadoc
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents: 586
diff changeset
167 }
74
6f1b88693d48 Complete refactoring to org.tmatesoft
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff changeset
168 }