comparison src/com/tmate/hgkit/ll/LocalHgRepo.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 4cfc47bc14cc
children 19e9e220bf68
comparison
equal deleted inserted replaced
58:4cfc47bc14cc 59:b771e94a4f7c
1 /* 1 /*
2 * Copyright (c) 2010, 2011 Artem Tikhomirov 2 * Copyright (c) 2010, 2011 Artem Tikhomirov
3 */ 3 */
4 package com.tmate.hgkit.ll; 4 package com.tmate.hgkit.ll;
5 5
6 import java.io.BufferedInputStream;
7 import java.io.BufferedReader; 6 import java.io.BufferedReader;
8 import java.io.File; 7 import java.io.File;
9 import java.io.FileFilter;
10 import java.io.FileInputStream; 8 import java.io.FileInputStream;
11 import java.io.FilenameFilter;
12 import java.io.IOException; 9 import java.io.IOException;
13 import java.io.InputStreamReader; 10 import java.io.InputStreamReader;
14 import java.lang.ref.SoftReference; 11 import java.lang.ref.SoftReference;
15 import java.util.Arrays; 12 import java.util.Arrays;
16 import java.util.Collections;
17 import java.util.HashMap; 13 import java.util.HashMap;
18 import java.util.LinkedList;
19 import java.util.Set;
20 import java.util.TreeSet; 14 import java.util.TreeSet;
21 15
22 import com.tmate.hgkit.fs.DataAccessProvider; 16 import com.tmate.hgkit.fs.DataAccessProvider;
23 import com.tmate.hgkit.fs.FileWalker; 17 import com.tmate.hgkit.fs.FileWalker;
24 18
54 public FileWalker createWorkingDirWalker() { 48 public FileWalker createWorkingDirWalker() {
55 return new FileWalker(repoDir.getParentFile()); 49 return new FileWalker(repoDir.getParentFile());
56 } 50 }
57 51
58 // XXX package-local, unless there are cases when required from outside (guess, working dir/revision walkers may hide dirstate access and no public visibility needed) 52 // XXX package-local, unless there are cases when required from outside (guess, working dir/revision walkers may hide dirstate access and no public visibility needed)
59 public final HgDirstate loadDirstate() { 53 final HgDirstate loadDirstate() {
60 // XXX may cache in SoftReference if creation is expensive 54 return new HgDirstate(getDataAccess(), new File(repoDir, "dirstate"));
61 return new HgDirstate(this, new File(repoDir, "dirstate"));
62 } 55 }
63 56
64 // package-local, see comment for loadDirstate 57 // package-local, see comment for loadDirstate
65 public final HgIgnore loadIgnore() { 58 public final HgIgnore loadIgnore() {
66 return new HgIgnore(this); 59 return new HgIgnore(this);