Mercurial > jhg
annotate src/org/tmatesoft/hg/internal/SubrepoManager.java @ 412:63c5a9d7ca3f smartgit3
Follow-up for Issue 29: unify path translation for manifest and dirstate
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 21 Mar 2012 14:54:02 +0100 |
parents | a0864b2892cd |
children | 9c9c442b5f2e |
rev | line source |
---|---|
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
1 /* |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011 TMate Software Ltd |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
3 * |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
4 * This program is free software; you can redistribute it and/or modify |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
6 * the Free Software Foundation; version 2 of the License. |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
7 * |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
8 * This program is distributed in the hope that it will be useful, |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
11 * GNU General Public License for more details. |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
12 * |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
13 * For information on how to redistribute this software under |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
14 * the terms of a license other than GNU General Public License |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
15 * contact TMate Software at support@hg4j.com |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
16 */ |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
17 package org.tmatesoft.hg.internal; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
18 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
19 import java.io.BufferedReader; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
20 import java.io.File; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
21 import java.io.FileReader; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
22 import java.io.IOException; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
23 import java.util.Arrays; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
24 import java.util.Collections; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
25 import java.util.HashMap; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
26 import java.util.LinkedList; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
27 import java.util.List; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
28 import java.util.Map; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
29 |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
30 import org.tmatesoft.hg.core.HgInvalidControlFileException; |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
31 import org.tmatesoft.hg.repo.HgRepository; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
32 import org.tmatesoft.hg.repo.HgSubrepoLocation; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
33 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
34 /** |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
35 * |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
36 * @author Artem Tikhomirov |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
37 * @author TMate Software Ltd. |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
38 */ |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
39 public class SubrepoManager /* XXX RepoChangeNotifier, RepoChangeListener */{ |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
40 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
41 private final HgRepository repo; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
42 private List<HgSubrepoLocation> subRepos; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
43 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
44 public SubrepoManager(HgRepository hgRepo) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
45 assert hgRepo != null; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
46 repo = hgRepo; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
47 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
48 |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
49 private List<HgSubrepoLocation> readActualState() throws HgInvalidControlFileException { |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
50 File hgsubFile = new File(repo.getWorkingDir(), ".hgsub"); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
51 if (!hgsubFile.canRead()) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
52 return Collections.emptyList(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
53 } |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
54 Map<String, String> state; // path -> revision |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
55 File hgstateFile = null; |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
56 try { |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
57 hgstateFile = new File(repo.getWorkingDir(), ".hgsubstate"); |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
58 if (hgstateFile.canRead()) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
59 state = readState(new BufferedReader(new FileReader(hgstateFile))); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
60 } else { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
61 state = Collections.emptyMap(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
62 } |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
63 } catch (IOException ex) { |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
64 throw new HgInvalidControlFileException("Subrepo state read failed", ex, hgstateFile); |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
65 } |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
66 try { |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
67 BufferedReader br = new BufferedReader(new FileReader(hgsubFile)); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
68 return readConfig(br, state); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
69 } catch (IOException ex) { |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
70 throw new HgInvalidControlFileException("Subrepo state read failed", ex, hgsubFile); |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
71 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
72 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
73 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
74 private List<HgSubrepoLocation> readConfig(BufferedReader br, Map<String, String> substate) throws IOException { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
75 try { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
76 String line; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
77 LinkedList<HgSubrepoLocation> res = new LinkedList<HgSubrepoLocation>(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
78 while ((line = br.readLine()) != null) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
79 int sep = line.indexOf('='); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
80 if (sep == -1) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
81 continue; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
82 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
83 // since both key and value are referenced from HgSubrepoLocation, doesn't make sense |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
84 // to have separate String instances (new String(line.substring())) |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
85 String key = line.substring(0, sep).trim(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
86 String value = line.substring(sep + 1).trim(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
87 if (value.length() == 0) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
88 // XXX log bad line? |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
89 continue; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
90 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
91 HgSubrepoLocation.Kind kind = HgSubrepoLocation.Kind.Hg; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
92 int kindEnd = value.indexOf(']', 1); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
93 if (value.charAt(0) == '[' && kindEnd != -1) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
94 String kindStr = value.substring(1, kindEnd); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
95 value = value.substring(kindEnd + 1); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
96 if ("svn".equals(kindStr)) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
97 kind = HgSubrepoLocation.Kind.SVN; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
98 } else if ("git".equals(kindStr)) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
99 kind = HgSubrepoLocation.Kind.Git; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
100 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
101 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
102 // TODO respect paths mappings in config file |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
103 HgSubrepoLocation loc = new HgSubrepoLocation(repo, key, value, kind, substate.get(key)); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
104 res.add(loc); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
105 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
106 return Arrays.asList(res.toArray(new HgSubrepoLocation[res.size()])); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
107 } finally { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
108 br.close(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
109 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
110 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
111 |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
112 private Map<String, String> readState(BufferedReader br) throws IOException { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
113 HashMap<String, String> rv = new HashMap<String, String>(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
114 try { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
115 String line; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
116 while ((line = br.readLine()) != null) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
117 int sep = line.trim().indexOf(' '); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
118 if (sep != -1) { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
119 rv.put(line.substring(sep+1).trim(), line.substring(0, sep).trim()); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
120 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
121 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
122 } finally { |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
123 br.close(); |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
124 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
125 return rv; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
126 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
127 |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
128 /*public to allow access from HgRepository, otherwise package-local*/ |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
129 public void read() throws HgInvalidControlFileException { |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
130 subRepos = readActualState(); |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
131 } |
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
132 |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
133 public List<HgSubrepoLocation> all(/*int revision, or TIP|WC*/) { |
348
a0864b2892cd
Expose errors reading mercurial control files with exception
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
295
diff
changeset
|
134 assert subRepos != null; |
239
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
135 return subRepos; |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
136 } |
df9d2854d3d6
Initial access to subrepositories
Artem Tikhomirov <tikhomirov.artem@gmail.com>
parents:
diff
changeset
|
137 } |