Mercurial > jhg
changeset 96:ace7042a5ce6
Internals to HgInternals
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 27 Jan 2011 21:24:37 +0100 |
parents | bcd31a4c638a |
children | ee2c750b036d |
files | cmdline/org/tmatesoft/hg/console/Cat.java cmdline/org/tmatesoft/hg/console/Status.java src/org/tmatesoft/hg/repo/HgInternals.java src/org/tmatesoft/hg/repo/Internals.java |
diffstat | 4 files changed, 53 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Cat.java Thu Jan 27 21:22:57 2011 +0100 +++ b/cmdline/org/tmatesoft/hg/console/Cat.java Thu Jan 27 21:24:37 2011 +0100 @@ -19,7 +19,7 @@ import org.tmatesoft.hg.internal.DigestHelper; import org.tmatesoft.hg.repo.HgDataFile; import org.tmatesoft.hg.repo.HgRepository; -import org.tmatesoft.hg.repo.Internals; +import org.tmatesoft.hg.repo.HgInternals; /** @@ -35,7 +35,7 @@ System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); return; } - Internals debug = new Internals(hgRepo); + HgInternals debug = new HgInternals(hgRepo); String[] toCheck = new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"}; boolean[] checkResult = debug.checkIgnored(toCheck); for (int i = 0; i < toCheck.length; i++) {
--- a/cmdline/org/tmatesoft/hg/console/Status.java Thu Jan 27 21:22:57 2011 +0100 +++ b/cmdline/org/tmatesoft/hg/console/Status.java Thu Jan 27 21:24:37 2011 +0100 @@ -28,7 +28,7 @@ import org.tmatesoft.hg.repo.HgDataFile; import org.tmatesoft.hg.repo.HgRepository; import org.tmatesoft.hg.repo.HgStatusInspector; -import org.tmatesoft.hg.repo.Internals; +import org.tmatesoft.hg.repo.HgInternals; import org.tmatesoft.hg.repo.HgStatusCollector; import org.tmatesoft.hg.repo.HgStatusCollector.Record; import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; @@ -82,7 +82,7 @@ } private static void bunchOfTests(HgRepository hgRepo) throws Exception { - Internals debug = new Internals(hgRepo); + HgInternals debug = new HgInternals(hgRepo); debug.dumpDirstate(); final StatusDump dump = new StatusDump(); dump.showIgnored = false;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/tmatesoft/hg/repo/HgInternals.java Thu Jan 27 21:24:37 2011 +0100 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2011 TMate Software Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For information on how to redistribute this software under + * the terms of a license other than GNU General Public License + * contact TMate Software at support@svnkit.com + */ +package org.tmatesoft.hg.repo; + + +/** + * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES. + * + * Debug helper, to access otherwise restricted (package-local) methods + * + * @author Artem Tikhomirov + * @author TMate Software Ltd. + + */ +public class HgInternals { + + private final HgRepository repo; + + public HgInternals(HgRepository hgRepo) { + repo = hgRepo; + } + + public void dumpDirstate() { + repo.loadDirstate().dump(); + } + + public boolean[] checkIgnored(String... toCheck) { + HgIgnore ignore = repo.getIgnore(); + boolean[] rv = new boolean[toCheck.length]; + for (int i = 0; i < toCheck.length; i++) { + rv[i] = ignore.isIgnored(toCheck[i]); + } + return rv; + } +}
--- a/src/org/tmatesoft/hg/repo/Internals.java Thu Jan 27 21:22:57 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 TMate Software Ltd - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For information on how to redistribute this software under - * the terms of a license other than GNU General Public License - * contact TMate Software at support@svnkit.com - */ -package org.tmatesoft.hg.repo; - - -/** - * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES. - * - * Debug helper, to access otherwise restricted (package-local) methods - * - * @author Artem Tikhomirov - * @author TMate Software Ltd. - - */ -public class Internals { - - private final HgRepository repo; - - public Internals(HgRepository hgRepo) { - repo = hgRepo; - } - - public void dumpDirstate() { - repo.loadDirstate().dump(); - } - - public boolean[] checkIgnored(String... toCheck) { - HgIgnore ignore = repo.getIgnore(); - boolean[] rv = new boolean[toCheck.length]; - for (int i = 0; i < toCheck.length; i++) { - rv[i] = ignore.isIgnored(toCheck[i]); - } - return rv; - } -}