comparison src/org/tmatesoft/hg/core/HgPushCommand.java @ 653:629a7370554c

Tests for recent changes in HgParentChildMap and RepositoryComparator (outgoing to respect drafts and Issue 47)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 03 Jul 2013 14:38:30 +0200
parents cd77bf51b562
children 12a4f60ea972
comparison
equal deleted inserted replaced
652:cd77bf51b562 653:629a7370554c
16 */ 16 */
17 package org.tmatesoft.hg.core; 17 package org.tmatesoft.hg.core;
18 18
19 import java.io.File; 19 import java.io.File;
20 import java.io.IOException; 20 import java.io.IOException;
21 import java.net.URL;
22 import java.util.ArrayList; 21 import java.util.ArrayList;
23 import java.util.List; 22 import java.util.List;
24 23
25 import org.tmatesoft.hg.internal.BundleGenerator; 24 import org.tmatesoft.hg.internal.BundleGenerator;
26 import org.tmatesoft.hg.internal.Internals; 25 import org.tmatesoft.hg.internal.Internals;
37 import org.tmatesoft.hg.repo.HgPhase; 36 import org.tmatesoft.hg.repo.HgPhase;
38 import org.tmatesoft.hg.repo.HgRemoteRepository; 37 import org.tmatesoft.hg.repo.HgRemoteRepository;
39 import org.tmatesoft.hg.repo.HgRepository; 38 import org.tmatesoft.hg.repo.HgRepository;
40 import org.tmatesoft.hg.repo.HgRuntimeException; 39 import org.tmatesoft.hg.repo.HgRuntimeException;
41 import org.tmatesoft.hg.util.CancelledException; 40 import org.tmatesoft.hg.util.CancelledException;
41 import org.tmatesoft.hg.util.LogFacility.Severity;
42 import org.tmatesoft.hg.util.Outcome; 42 import org.tmatesoft.hg.util.Outcome;
43 import org.tmatesoft.hg.util.Pair; 43 import org.tmatesoft.hg.util.Pair;
44 import org.tmatesoft.hg.util.ProgressSupport; 44 import org.tmatesoft.hg.util.ProgressSupport;
45 import org.tmatesoft.hg.util.LogFacility.Severity;
46 45
47 /** 46 /**
48 * 47 *
49 * @author Artem Tikhomirov 48 * @author Artem Tikhomirov
50 * @author TMate Software Ltd. 49 * @author TMate Software Ltd.
218 RevisionSet localChildrenNotSent = outgoing.children(parentHelper).subtract(outgoing); 217 RevisionSet localChildrenNotSent = outgoing.children(parentHelper).subtract(outgoing);
219 // remote shall know only what we've sent, subtract revisions we didn't actually sent 218 // remote shall know only what we've sent, subtract revisions we didn't actually sent
220 remoteDrafts = remoteDrafts.subtract(localChildrenNotSent); 219 remoteDrafts = remoteDrafts.subtract(localChildrenNotSent);
221 return remoteDrafts; 220 return remoteDrafts;
222 } 221 }
223
224 /*
225 * To test, start a server:
226 * $ hg --config web.allow_push=* --config web.push_ssl=False --config server.validate=True --debug serve
227 */
228 public static void main(String[] args) throws Exception {
229 final HgLookup hgLookup = new HgLookup();
230 HgRepository r = hgLookup.detect("/home/artem/hg/test-phases/");
231 HgRemoteRepository rr = hgLookup.detect(new URL("http://localhost:8000/"));
232 new HgPushCommand(r).destination(rr).execute();
233 }
234 } 222 }