diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/tmate/hgkit/ll/Internals.java	Tue Jan 18 00:08:15 2011 +0100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Artem Tikhomirov 
+ */
+package com.tmate.hgkit.ll;
+
+/**
+ * DO NOT USE THIS CLASS, INTENDED FOR TESTING PURPOSES.
+ * 
+ * Debug helper, to access otherwise restricted (package-local) methods
+ * 
+ * @author artem
+ */
+public class Internals {
+
+	private final HgRepository repo;
+
+	public Internals(HgRepository hgRepo) {
+		this.repo = hgRepo;
+	}
+
+	public void dumpDirstate() {
+		if (repo instanceof LocalHgRepo) {
+			((LocalHgRepo) repo).loadDirstate().dump();
+		}
+	}
+
+	public boolean[] checkIgnored(String... toCheck) {
+		if (repo instanceof LocalHgRepo) {
+			HgIgnore ignore = ((LocalHgRepo) repo).loadIgnore();
+			boolean[] rv = new boolean[toCheck.length];
+			for (int i = 0; i < toCheck.length; i++) {
+				rv[i] = ignore.isIgnored(toCheck[i]);
+			}
+			return rv;
+		}
+		return new boolean[0];
+	}
+}