Mercurial > jhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 170:71ddbf8603e8 | 171:2c3e96674e2a |
|---|---|
| 15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
| 16 */ | 16 */ |
| 17 package org.tmatesoft.hg.repo; | 17 package org.tmatesoft.hg.repo; |
| 18 | 18 |
| 19 import java.io.File; | 19 import java.io.File; |
| 20 import java.net.URL; | |
| 21 import java.util.Collections; | |
| 20 import java.util.List; | 22 import java.util.List; |
| 21 | 23 |
| 22 import org.tmatesoft.hg.core.HgException; | 24 import org.tmatesoft.hg.core.HgException; |
| 23 import org.tmatesoft.hg.core.Nodeid; | 25 import org.tmatesoft.hg.core.Nodeid; |
| 24 | 26 |
| 29 * | 31 * |
| 30 * @author Artem Tikhomirov | 32 * @author Artem Tikhomirov |
| 31 * @author TMate Software Ltd. | 33 * @author TMate Software Ltd. |
| 32 */ | 34 */ |
| 33 public class HgRemoteRepository { | 35 public class HgRemoteRepository { |
| 36 | |
| 37 HgRemoteRepository(URL url) { | |
| 38 } | |
| 39 | |
| 40 public List<Nodeid> heads() { | |
| 41 return Collections.emptyList(); | |
| 42 } | |
| 43 | |
| 44 public List<Nodeid> between(Nodeid base, Nodeid tip) { | |
| 45 return Collections.emptyList(); | |
| 46 } | |
| 47 | |
| 48 public List<RemoteBranch> branches(List<Nodeid> nodes) { | |
| 49 return Collections.emptyList(); | |
| 50 } | |
| 34 | 51 |
| 35 // WireProtocol wiki: roots = a list of the latest nodes on every service side changeset branch that both the client and server know about. | 52 // WireProtocol wiki: roots = a list of the latest nodes on every service side changeset branch that both the client and server know about. |
| 36 public HgBundle getChanges(List<Nodeid> roots) throws HgException { | 53 public HgBundle getChanges(List<Nodeid> roots) throws HgException { |
| 37 return new HgLookup().loadBundle(new File("/temp/hg/hg-bundle-000000000000-gz.tmp")); | 54 return new HgLookup().loadBundle(new File("/temp/hg/hg-bundle-000000000000-gz.tmp")); |
| 38 } | 55 } |
| 56 | |
| 57 public static final class RemoteBranch { | |
| 58 public final Nodeid head, root, p1, p2; | |
| 59 | |
| 60 public RemoteBranch(Nodeid h, Nodeid r, Nodeid parent1, Nodeid parent2) { | |
| 61 head = h; | |
| 62 root = r; | |
| 63 p1 = parent1; | |
| 64 p2 = parent2; | |
| 65 } | |
| 66 | |
| 67 @Override | |
| 68 public boolean equals(Object obj) { | |
| 69 if (this == obj) { | |
| 70 return true; | |
| 71 } | |
| 72 if (false == obj instanceof RemoteBranch) { | |
| 73 return false; | |
| 74 } | |
| 75 RemoteBranch o = (RemoteBranch) obj; | |
| 76 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)); | |
| 77 } | |
| 78 } | |
| 39 } | 79 } |
