tikhomirov@427: /*
tikhomirov@427: * Copyright (c) 2011-2012 TMate Software Ltd
tikhomirov@427: *
tikhomirov@427: * This program is free software; you can redistribute it and/or modify
tikhomirov@427: * it under the terms of the GNU General Public License as published by
tikhomirov@427: * the Free Software Foundation; version 2 of the License.
tikhomirov@427: *
tikhomirov@427: * This program is distributed in the hope that it will be useful,
tikhomirov@427: * but WITHOUT ANY WARRANTY; without even the implied warranty of
tikhomirov@427: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tikhomirov@427: * GNU General Public License for more details.
tikhomirov@427: *
tikhomirov@427: * For information on how to redistribute this software under
tikhomirov@427: * the terms of a license other than GNU General Public License
tikhomirov@427: * contact TMate Software at support@hg4j.com
tikhomirov@427: */
tikhomirov@427: package org.tmatesoft.hg.core;
tikhomirov@427:
tikhomirov@427: import org.tmatesoft.hg.internal.Callback;
tikhomirov@628: import org.tmatesoft.hg.repo.HgRuntimeException;
tikhomirov@427: import org.tmatesoft.hg.util.Path;
tikhomirov@427:
tikhomirov@427: /**
tikhomirov@427: * Callback to walk file/directory tree of a revision
tikhomirov@427: *
tikhomirov@427: * @author Artem Tikhomirov
tikhomirov@427: * @author TMate Software Ltd.
tikhomirov@427: */
tikhomirov@427: @Callback
tikhomirov@427: public interface HgManifestHandler {
tikhomirov@427: /**
tikhomirov@427: * Indicates start of manifest revision. Subsequent {@link #file(HgFileRevision)} and {@link #dir(Path)} come
tikhomirov@427: * from the specified manifest revision until {@link #end(Nodeid)} with the matching revision is invoked.
tikhomirov@427: *
tikhomirov@427: * @param manifestRevision unique identifier of the manifest revision
tikhomirov@427: * @throws HgCallbackTargetException wrapper for any exception user code may produce
tikhomirov@628: * @throws HgRuntimeException propagates library issues. Runtime exception
tikhomirov@427: */
tikhomirov@628: void begin(Nodeid manifestRevision) throws HgCallbackTargetException, HgRuntimeException;
tikhomirov@427:
tikhomirov@427: /**
tikhomirov@427: * If walker is configured to spit out directories, indicates files from specified directories are about to be reported.
tikhomirov@427: * Comes prior to any files from this directory and subdirectories
tikhomirov@427: *
tikhomirov@427: * @param path directory known in the manifest
tikhomirov@427: * @throws HgCallbackTargetException wrapper for any exception user code may produce
tikhomirov@628: * @throws HgRuntimeException propagates library issues. Runtime exception
tikhomirov@427: */
tikhomirov@628: void dir(Path path) throws HgCallbackTargetException, HgRuntimeException;
tikhomirov@427:
tikhomirov@427: /**
tikhomirov@427: * Reports a file revision entry in the manifest
tikhomirov@427: *
tikhomirov@427: * @param fileRevision description of the file revision
tikhomirov@427: * @throws HgCallbackTargetException wrapper for any exception user code may produce
tikhomirov@628: * @throws HgRuntimeException propagates library issues. Runtime exception
tikhomirov@427: */
tikhomirov@628: void file(HgFileRevision fileRevision) throws HgCallbackTargetException, HgRuntimeException;
tikhomirov@427:
tikhomirov@427: /**
tikhomirov@427: * Indicates all files from the manifest revision have been reported.
tikhomirov@427: * Closes {@link #begin(Nodeid)} with the same revision that came before.
tikhomirov@427: *
tikhomirov@427: * @param manifestRevision unique identifier of the manifest revision
tikhomirov@427: * @throws HgCallbackTargetException wrapper for any exception user code may produce
tikhomirov@628: * @throws HgRuntimeException propagates library issues. Runtime exception
tikhomirov@427: */
tikhomirov@628: void end(Nodeid manifestRevision) throws HgCallbackTargetException, HgRuntimeException;
tikhomirov@427: }