diff src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 171:2c3e96674e2a

Towards outgoing changes - initial detection logic, get connected with remote repo stub
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 25 Mar 2011 00:05:52 +0100
parents 71ddbf8603e8
children 87f40938c9b2
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Wed Mar 23 20:46:00 2011 +0100
+++ b/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Fri Mar 25 00:05:52 2011 +0100
@@ -17,6 +17,8 @@
 package org.tmatesoft.hg.repo;
 
 import java.io.File;
+import java.net.URL;
+import java.util.Collections;
 import java.util.List;
 
 import org.tmatesoft.hg.core.HgException;
@@ -31,9 +33,47 @@
  * @author TMate Software Ltd.
  */
 public class HgRemoteRepository {
+	
+	HgRemoteRepository(URL url) {
+	}
+	
+	public List<Nodeid> heads() {
+		return Collections.emptyList();
+	}
+	
+	public List<Nodeid> between(Nodeid base, Nodeid tip) {
+		return Collections.emptyList();
+	}
+
+	public List<RemoteBranch> branches(List<Nodeid> nodes) {
+		return Collections.emptyList();
+	}
 
 	// WireProtocol wiki: roots = a list of the latest nodes on every service side changeset branch that both the client and server know about. 
 	public HgBundle getChanges(List<Nodeid> roots) throws HgException {
 		return new HgLookup().loadBundle(new File("/temp/hg/hg-bundle-000000000000-gz.tmp"));
 	}
+
+	public static final class RemoteBranch {
+		public final Nodeid head, root, p1, p2;
+		
+		public RemoteBranch(Nodeid h, Nodeid r, Nodeid parent1, Nodeid parent2) {
+			head = h;
+			root = r;
+			p1 = parent1;
+			p2 = parent2;
+		}
+
+		@Override
+		public boolean equals(Object obj) {
+			if (this == obj) {
+				return true;
+			}
+			if (false == obj instanceof RemoteBranch) {
+				return false;
+			}
+			RemoteBranch o = (RemoteBranch) obj;
+			return head.equals(o.head) && root.equals(o.root) && (p1 == null && o.p1 == null || p1.equals(o.p1)) && (p2 == null && o.p2 == null || p2.equals(o.p2));
+		}
+	}
 }