comparison src/org/tmatesoft/hg/core/HgPullCommand.java @ 664:ae2d439fbed3

Utilize transaction when writing fncache. Better HgIOException
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 10 Jul 2013 19:33:51 +0200
parents 46b56864b483
children d25f0324a27a
comparison
equal deleted inserted replaced
663:46b56864b483 664:ae2d439fbed3
14 * the terms of a license other than GNU General Public License 14 * the terms of a license other than GNU General Public License
15 * contact TMate Software at support@hg4j.com 15 * contact TMate Software at support@hg4j.com
16 */ 16 */
17 package org.tmatesoft.hg.core; 17 package org.tmatesoft.hg.core;
18 18
19 import java.io.IOException;
20 import java.util.Collection; 19 import java.util.Collection;
21 import java.util.Collections; 20 import java.util.Collections;
22 import java.util.List; 21 import java.util.List;
23 22
24 import org.tmatesoft.hg.internal.AddRevInspector; 23 import org.tmatesoft.hg.internal.AddRevInspector;
37 import org.tmatesoft.hg.repo.HgRuntimeException; 36 import org.tmatesoft.hg.repo.HgRuntimeException;
38 import org.tmatesoft.hg.util.CancelledException; 37 import org.tmatesoft.hg.util.CancelledException;
39 import org.tmatesoft.hg.util.ProgressSupport; 38 import org.tmatesoft.hg.util.ProgressSupport;
40 39
41 /** 40 /**
41 * 'hg pull <remote>' counterpart, get remote changes to local repository
42 * 42 *
43 * @since 1.2
43 * @author Artem Tikhomirov 44 * @author Artem Tikhomirov
44 * @author TMate Software Ltd. 45 * @author TMate Software Ltd.
45 */ 46 */
46 public class HgPullCommand extends HgAbstractCommand<HgPullCommand> { 47 public class HgPullCommand extends HgAbstractCommand<HgPullCommand> {
47 48
83 insp.done(); 84 insp.done();
84 tr.commit(); 85 tr.commit();
85 } catch (HgRuntimeException ex) { 86 } catch (HgRuntimeException ex) {
86 tr.rollback(); 87 tr.rollback();
87 throw ex; 88 throw ex;
88 } catch (IOException ex) { 89 } catch (HgIOException ex) {
89 tr.rollback(); 90 tr.rollback();
90 throw new HgIOException(ex.getMessage(), ex, null); // FIXME throw HgIOException right away 91 throw ex;
91 } catch (RuntimeException ex) { 92 } catch (RuntimeException ex) {
92 tr.rollback(); 93 tr.rollback();
93 throw ex; 94 throw ex;
94 } 95 }
95 progress.worked(45); 96 progress.worked(45);