diff src/org/tmatesoft/hg/repo/Revlog.java @ 192:e5407b5a586a

Incoming and Outgoing commands are alive
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 15 Apr 2011 03:17:03 +0200
parents b777502a06f5
children 3a7696fb457c
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/Revlog.java	Thu Apr 14 19:53:31 2011 +0200
+++ b/src/org/tmatesoft/hg/repo/Revlog.java	Fri Apr 15 03:17:03 2011 +0200
@@ -208,6 +208,10 @@
 			firstParent = secondParent = Collections.emptyMap();
 		}
 		
+		public HgRepository getRepo() {
+			return Revlog.this.getRepo();
+		}
+		
 		public void init() {
 			final RevlogStream stream = Revlog.this.content;
 			final int revisionCount = stream.revisionCount();
@@ -310,6 +314,16 @@
 			orderedResult.retainAll(result);
 			return orderedResult;
 		}
+		
+		/**
+		 * @param node possibly parent node
+		 * @return <code>true</code> if there's any node in this revlog that has specified node as one of its parents. 
+		 */
+		public boolean hasChildren(Nodeid node) {
+			// FIXME containsValue is linear, likely. May want to optimize it with another (Tree|Hash)Set, created on demand
+			// on first use
+			return firstParent.containsValue(node) || secondParent.containsValue(node);
+		}
 	}
 
 	protected static class ContentPipe implements RevlogStream.Inspector, CancelSupport {