Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 673:545b1d4cc11d
Refactor HgBundle.GroupElement (clear experimental mark), resolve few technical debt issues
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 12 Jul 2013 20:14:24 +0200 |
parents | cd77bf51b562 |
children | 9897cbfd2790 |
comparison
equal
deleted
inserted
replaced
672:d2552e6a5af6 | 673:545b1d4cc11d |
---|---|
63 import org.tmatesoft.hg.core.HgRepositoryNotFoundException; | 63 import org.tmatesoft.hg.core.HgRepositoryNotFoundException; |
64 import org.tmatesoft.hg.core.Nodeid; | 64 import org.tmatesoft.hg.core.Nodeid; |
65 import org.tmatesoft.hg.core.SessionContext; | 65 import org.tmatesoft.hg.core.SessionContext; |
66 import org.tmatesoft.hg.internal.DataSerializer; | 66 import org.tmatesoft.hg.internal.DataSerializer; |
67 import org.tmatesoft.hg.internal.DataSerializer.OutputStreamSerializer; | 67 import org.tmatesoft.hg.internal.DataSerializer.OutputStreamSerializer; |
68 import org.tmatesoft.hg.internal.BundleSerializer; | |
68 import org.tmatesoft.hg.internal.EncodingHelper; | 69 import org.tmatesoft.hg.internal.EncodingHelper; |
69 import org.tmatesoft.hg.internal.Internals; | 70 import org.tmatesoft.hg.internal.Internals; |
70 import org.tmatesoft.hg.internal.PropertyMarshal; | 71 import org.tmatesoft.hg.internal.PropertyMarshal; |
71 import org.tmatesoft.hg.util.LogFacility.Severity; | 72 import org.tmatesoft.hg.util.LogFacility.Severity; |
72 import org.tmatesoft.hg.util.Outcome; | 73 import org.tmatesoft.hg.util.Outcome; |
420 throw Internals.notImplemented(); | 421 throw Internals.notImplemented(); |
421 } | 422 } |
422 StringBuilder sb = appendNodeidListArgument("heads", remoteHeads, null); | 423 StringBuilder sb = appendNodeidListArgument("heads", remoteHeads, null); |
423 | 424 |
424 HttpURLConnection c = null; | 425 HttpURLConnection c = null; |
425 DataSerializer.DataSource bundleData = bundle.new BundleSerializer(); | 426 DataSerializer.DataSource bundleData = BundleSerializer.newInstance(sessionContext, bundle); |
426 try { | 427 try { |
427 URL u = new URL(url, url.getPath() + "?cmd=unbundle&" + sb.toString()); | 428 URL u = new URL(url, url.getPath() + "?cmd=unbundle&" + sb.toString()); |
428 c = setupConnection(u.openConnection()); | 429 c = setupConnection(u.openConnection()); |
429 c.setRequestMethod("POST"); | 430 c.setRequestMethod("POST"); |
430 c.setRequestProperty("Content-Length", String.valueOf(bundleData.serializeLength())); | 431 c.setRequestProperty("Content-Length", String.valueOf(bundleData.serializeLength())); |