summaryrefslogtreecommitdiff
path: root/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-18 13:38:58 -0700
committerTor Norbye <tnorbye@google.com>2014-09-18 13:38:58 -0700
commitb5fb31ef6a38f19404859755dbd2e345215b97bf (patch)
treee8787c45e494dfcc558faf0f75956f8785c39b94 /plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
parente222a9e1e66670a56e926a6b0f3e10231eeeb1fb (diff)
parente782c57d74000722f9db4c9426317410520670c6 (diff)
downloadidea-b5fb31ef6a38f19404859755dbd2e345215b97bf.tar.gz
Merge remote-tracking branch 'aosp/upstream-master' into merge
Conflicts: .idea/libraries/asm_tools.xml .idea/libraries/bouncy_castle.xml .idea/libraries/builder_model.xml .idea/libraries/commons_compress.xml .idea/libraries/easymock_tools.xml .idea/libraries/freemarker_2_3_20.xml .idea/libraries/guava_tools.xml .idea/libraries/kxml2.xml .idea/libraries/lombok_ast.xml .idea/libraries/mockito.xml .idea/modules.xml .idea/vcs.xml build/scripts/layouts.gant updater/src/com/intellij/updater/Runner.java Change-Id: I8e1c173e00cd76c855b8a98543b0a0edfdd99d12
Diffstat (limited to 'plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java')
-rw-r--r--plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
index 923087d0b3b2..fab661a99a32 100644
--- a/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
+++ b/plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
@@ -48,10 +48,10 @@ public class HgRepositoryReader {
private static Pattern HASH_NAME = Pattern.compile("\\s*([0-9a-fA-F]+)\\s+(.+)");
private static Pattern HASH_STATUS_NAME = Pattern.compile("\\s*([0-9a-fA-F]+)\\s+\\w\\s+(.+)");
- //hash + name_or_revision_num; hash + status_character + name_or_revision_num
+ //hash + name_or_revision_num; hash + status_character + name_or_revision_num
@NotNull private final File myHgDir; // .hg
- @NotNull private File myBranchHeadsFile; // .hg/cache/branch* + part depends on version
+ @NotNull private File myBranchHeadsFile; // .hg/cache/branch* + part depends on version
@NotNull private final File myCacheDir; // .hg/cache (does not exist before first commit)
@NotNull private final File myCurrentBranch; // .hg/branch
@NotNull private final File myBookmarksFile; //.hg/bookmarks
@@ -59,6 +59,8 @@ public class HgRepositoryReader {
@NotNull private final File myTagsFile; //.hgtags - not in .hg directory!!!
@NotNull private final File myLocalTagsFile; // .hg/localtags
@NotNull private final File myDirStateFile; // .hg/dirstate
+ @NotNull private final File mySubrepoFile; // .hgsubstate
+
@NotNull private final VcsLogObjectsFactory myVcsObjectsFactory;
private final boolean myStatusInBranchFile;
@NotNull final HgVcs myVcs;
@@ -76,6 +78,7 @@ public class HgRepositoryReader {
myCurrentBookmark = new File(myHgDir, "bookmarks.current");
myLocalTagsFile = new File(myHgDir, "localtags");
myTagsFile = new File(myHgDir.getParentFile(), ".hgtags");
+ mySubrepoFile = new File(myHgDir.getParentFile(), ".hgsubstate");
myDirStateFile = new File(myHgDir, "dirstate");
myVcsObjectsFactory = ServiceManager.getService(vcs.getProject(), VcsLogObjectsFactory.class);
}
@@ -192,6 +195,10 @@ public class HgRepositoryReader {
return new File(myHgDir, "merge").exists();
}
+ public boolean hasSubrepos() {
+ return mySubrepoFile.exists();
+ }
+
public boolean isRebaseInProgress() {
return new File(myHgDir, "rebasestate").exists();
}
@@ -248,4 +255,11 @@ public class HgRepositoryReader {
public String readCurrentBookmark() {
return myCurrentBookmark.exists() ? RepositoryUtil.tryLoadFile(myCurrentBookmark) : null;
}
+
+ @NotNull
+ public Collection<HgNameWithHashInfo> readSubrepos() {
+ if (!hasSubrepos()) return Collections.emptySet();
+ return readReference(mySubrepoFile);
+ }
+
}