comparison src/com/tmate/hgkit/ll/Internals.java @ 59:b771e94a4f7c

Introduce Internals to keep LocalHgRepo casts and alike in a single place. WCSC optionally to reuse SC data
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 18 Jan 2011 00:08:15 +0100
parents
children
comparison
equal deleted inserted replaced
58:4cfc47bc14cc 59:b771e94a4f7c
1 /*
2 * Copyright (c) 2011 Artem Tikhomirov
3 */
4 package com.tmate.hgkit.ll;
5
6 /**
7 * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES.
8 *
9 * Debug helper, to access otherwise restricted (package-local) methods
10 *
11 * @author artem
12 */
13 public class Internals {
14
15 private final HgRepository repo;
16
17 public Internals(HgRepository hgRepo) {
18 this.repo = hgRepo;
19 }
20
21 public void dumpDirstate() {
22 if (repo instanceof LocalHgRepo) {
23 ((LocalHgRepo) repo).loadDirstate().dump();
24 }
25 }
26
27 public boolean[] checkIgnored(String... toCheck) {
28 if (repo instanceof LocalHgRepo) {
29 HgIgnore ignore = ((LocalHgRepo) repo).loadIgnore();
30 boolean[] rv = new boolean[toCheck.length];
31 for (int i = 0; i < toCheck.length; i++) {
32 rv[i] = ignore.isIgnored(toCheck[i]);
33 }
34 return rv;
35 }
36 return new boolean[0];
37 }
38 }