Mercurial > hg4j
comparison src/org/tmatesoft/hg/core/RepositoryFacade.java @ 74:6f1b88693d48
Complete refactoring to org.tmatesoft
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 24 Jan 2011 03:14:45 +0100 |
parents | |
children | bcd31a4c638a |
comparison
equal
deleted
inserted
replaced
73:0d279bcc4442 | 74:6f1b88693d48 |
---|---|
1 /* | |
2 * Copyright (c) 2011 TMate Software Ltd | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * For information on how to redistribute this software under | |
14 * the terms of a license other than GNU General Public License | |
15 * contact TMate Software at support@svnkit.com | |
16 */ | |
17 package org.tmatesoft.hg.core; | |
18 | |
19 import java.io.File; | |
20 | |
21 import org.tmatesoft.hg.repo.HgRepository; | |
22 import org.tmatesoft.hg.repo.Lookup; | |
23 | |
24 /** | |
25 * | |
26 * @author Artem Tikhomirov | |
27 * @author TMate Software Ltd. | |
28 */ | |
29 public class RepositoryFacade { | |
30 private HgRepository repo; | |
31 | |
32 public RepositoryFacade() { | |
33 } | |
34 | |
35 public boolean init() throws Exception /*FIXME RepoInitException*/ { | |
36 repo = new Lookup().detectFromWorkingDir(); | |
37 return repo != null && !repo.isInvalid(); | |
38 } | |
39 | |
40 public boolean initFrom(File repoLocation) throws Exception { | |
41 repo = new Lookup().detect(repoLocation.getCanonicalPath()); | |
42 return repo != null && !repo.isInvalid(); | |
43 } | |
44 | |
45 public LogCommand createLogCommand() { | |
46 return new LogCommand(repo/*, getCommandContext()*/); | |
47 } | |
48 public StatusCommand createStatusCommand() { | |
49 return new StatusCommand(repo/*, getCommandContext()*/); | |
50 } | |
51 } |