comparison src/org/tmatesoft/hg/core/HgOutgoingCommand.java @ 322:d68dcb3b5f49

Propagate command's CancelSupport to low-level API. CancelSupport from context got priority over one from command
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 30 Sep 2011 08:00:04 +0200
parents 981f9f50bb6c
children 5f9073eabf06
comparison
equal deleted inserted replaced
321:ac38e75c9e8e 322:d68dcb3b5f49
96 */ 96 */
97 public List<Nodeid> executeLite() throws HgRemoteConnectionException, CancelledException { 97 public List<Nodeid> executeLite() throws HgRemoteConnectionException, CancelledException {
98 final ProgressSupport ps = getProgressSupport(null); 98 final ProgressSupport ps = getProgressSupport(null);
99 try { 99 try {
100 ps.start(10); 100 ps.start(10);
101 return getComparator(new ProgressSupport.Sub(ps, 5), getCancelSupport(null)).getLocalOnlyRevisions(); 101 return getComparator(new ProgressSupport.Sub(ps, 5), getCancelSupport(null, true)).getLocalOnlyRevisions();
102 } finally { 102 } finally {
103 ps.done(); 103 ps.done();
104 } 104 }
105 } 105 }
106 106
112 public void executeFull(final HgChangesetHandler handler) throws HgRemoteConnectionException, HgCallbackTargetException, CancelledException { 112 public void executeFull(final HgChangesetHandler handler) throws HgRemoteConnectionException, HgCallbackTargetException, CancelledException {
113 if (handler == null) { 113 if (handler == null) {
114 throw new IllegalArgumentException("Delegate can't be null"); 114 throw new IllegalArgumentException("Delegate can't be null");
115 } 115 }
116 final ProgressSupport ps = getProgressSupport(handler); 116 final ProgressSupport ps = getProgressSupport(handler);
117 final CancelSupport cs = getCancelSupport(handler); 117 final CancelSupport cs = getCancelSupport(handler, true);
118 try { 118 try {
119 ps.start(-1); 119 ps.start(-1);
120 ChangesetTransformer inspector = new ChangesetTransformer(localRepo, handler, getParentHelper(), ps, cs); 120 ChangesetTransformer inspector = new ChangesetTransformer(localRepo, handler, getParentHelper(), ps, cs);
121 inspector.limitBranches(branches); 121 inspector.limitBranches(branches);
122 getComparator(new ProgressSupport.Sub(ps, 1), cs).visitLocalOnlyRevisions(inspector); 122 getComparator(new ProgressSupport.Sub(ps, 1), cs).visitLocalOnlyRevisions(inspector);