Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/IterateControlMediator.java @ 520:1ee452f31187
Experimental support for inverse direction history walking. Refactored/streamlined cancellation in HgLogCommand and down the stack
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 21 Dec 2012 21:20:26 +0100 |
parents | f9f3e9b67ccc |
children |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/IterateControlMediator.java Thu Dec 20 20:21:59 2012 +0100 +++ b/src/org/tmatesoft/hg/internal/IterateControlMediator.java Fri Dec 21 21:20:26 2012 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 TMate Software Ltd + * Copyright (c) 2011-2012 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,8 @@ public class IterateControlMediator { private final CancelSupport src; - private Callback receiver; + private final Callback receiver; + private CancelledException cancellation; public IterateControlMediator(CancelSupport source, Lifecycle.Callback target) { assert target != null; @@ -40,11 +41,15 @@ if (src == null) { return false; } + if (cancellation != null) { + return true; + } try { src.checkCancelled(); return false; } catch (CancelledException ex) { receiver.stop(); + cancellation = ex; return true; } } @@ -52,4 +57,8 @@ public void stop() { receiver.stop(); } + + public CancelledException getCancelException() { + return cancellation; + } }