comparison src/org/tmatesoft/hg/core/HgPushCommand.java @ 671:002ed1b2baad

AIOOBE in BundleGenerator.ChunkGenerator.iterate when there are no outgoing changes on push
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 12 Jul 2013 15:29:37 +0200
parents 52af7f62e731
children
comparison
equal deleted inserted replaced
670:52af7f62e731 671:002ed1b2baad
85 RevisionSet secret = phaseHelper.allSecret(); 85 RevisionSet secret = phaseHelper.allSecret();
86 outgoing = new RevisionSet(l).subtract(secret); 86 outgoing = new RevisionSet(l).subtract(secret);
87 } else { 87 } else {
88 outgoing = new RevisionSet(l); 88 outgoing = new RevisionSet(l);
89 } 89 }
90 HgBundle b = null;
90 if (!outgoing.isEmpty()) { 91 if (!outgoing.isEmpty()) {
91 // 92 //
92 // prepare bundle 93 // prepare bundle
93 BundleGenerator bg = new BundleGenerator(implRepo); 94 BundleGenerator bg = new BundleGenerator(implRepo);
94 File bundleFile = bg.create(outgoing.asList()); 95 File bundleFile = bg.create(outgoing.asList());
95 progress.worked(20); 96 progress.worked(20);
96 HgBundle b = new HgLookup(repo.getSessionContext()).loadBundle(bundleFile); 97 b = new HgLookup(repo.getSessionContext()).loadBundle(bundleFile);
97 // 98 //
98 // send changes 99 // send changes
99 remoteRepo.unbundle(b, comparator.getRemoteHeads()); 100 remoteRepo.unbundle(b, comparator.getRemoteHeads());
100 } // update phase information nevertheless 101 } // update phase information nevertheless
101 progress.worked(20); 102 progress.worked(20);
135 } 136 }
136 } 137 }
137 } 138 }
138 // XXX WTF is obsolete in namespaces key?? 139 // XXX WTF is obsolete in namespaces key??
139 progress.worked(5); 140 progress.worked(5);
140 b.unlink(); // keep the file only in case of failure 141 if (b != null) {
142 b.unlink(); // keep the file only in case of failure
143 }
141 } catch (IOException ex) { 144 } catch (IOException ex) {
142 throw new HgIOException(ex.getMessage(), null); // XXX not a nice idea to throw IOException from BundleGenerator#create 145 throw new HgIOException(ex.getMessage(), null); // XXX not a nice idea to throw IOException from BundleGenerator#create
143 } catch (HgRepositoryNotFoundException ex) { 146 } catch (HgRepositoryNotFoundException ex) {
144 final HgInvalidStateException e = new HgInvalidStateException("Failed to load a just-created bundle"); 147 final HgInvalidStateException e = new HgInvalidStateException("Failed to load a just-created bundle");
145 e.initCause(ex); 148 e.initCause(ex);