# HG changeset patch # User Artem Tikhomirov # Date 1297878130 -3600 # Node ID 2e395db595e2df149e31a4807facdb3623db8bff # Parent b92a638764be70366f09b040b49ac1dfa6736096 Moved HgStatus to toplevel diff -r b92a638764be -r 2e395db595e2 src/org/tmatesoft/hg/core/HgStatus.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/tmatesoft/hg/core/HgStatus.java Wed Feb 16 18:42:10 2011 +0100 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2011 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 + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For information on how to redistribute this software under + * the terms of a license other than GNU General Public License + * contact TMate Software at support@svnkit.com + */ +package org.tmatesoft.hg.core; + +public class HgStatus { + + public enum Kind { + Modified, Added, Removed, Unknown, Missing, Clean, Ignored + }; + + private final HgStatus.Kind kind; + private final Path path; + private final Path origin; + + HgStatus(HgStatus.Kind kind, Path path) { + this(kind, path, null); + } + + HgStatus(HgStatus.Kind kind, Path path, Path copyOrigin) { + this.kind = kind; + this.path = path; + origin = copyOrigin; + } + + public HgStatus.Kind getKind() { + return kind; + } + + public Path getPath() { + return path; + } + + public Path getOriginalPath() { + return origin; + } + + public boolean isCopy() { + return origin != null; + } + +// public String getModificationAuthor() { +// } +// +// public Date getModificationDate() { +// } +} \ No newline at end of file diff -r b92a638764be -r 2e395db595e2 src/org/tmatesoft/hg/core/StatusCommand.java --- a/src/org/tmatesoft/hg/core/StatusCommand.java Tue Feb 15 07:03:14 2011 +0100 +++ b/src/org/tmatesoft/hg/core/StatusCommand.java Wed Feb 16 18:42:10 2011 +0100 @@ -16,13 +16,12 @@ */ package org.tmatesoft.hg.core; -import static org.tmatesoft.hg.core.StatusCommand.HgStatus.Kind.*; +import static org.tmatesoft.hg.core.HgStatus.Kind.*; import static org.tmatesoft.hg.repo.HgRepository.*; import java.util.ConcurrentModificationException; import org.tmatesoft.hg.core.Path.Matcher; -import org.tmatesoft.hg.core.StatusCommand.HgStatus.Kind; import org.tmatesoft.hg.repo.HgRepository; import org.tmatesoft.hg.repo.HgStatusCollector; import org.tmatesoft.hg.repo.HgStatusInspector; @@ -177,42 +176,6 @@ void handleStatus(HgStatus s); } - public static class HgStatus { - public enum Kind { - Modified, Added, Removed, Unknown, Missing, Clean, Ignored - }; - private final Kind kind; - private final Path path; - private final Path origin; - - HgStatus(Kind kind, Path path) { - this(kind, path, null); - } - - HgStatus(Kind kind, Path path, Path copyOrigin) { - this.kind = kind; - this.path = path; - origin = copyOrigin; - } - - public Kind getKind() { - return kind; - } - - public Path getPath() { - return path; - } - - public Path getOriginalPath() { - return origin; - } - - public boolean isCopy() { - return origin != null; - } - } - - private class Mediator implements HgStatusInspector { boolean needModified; boolean needAdded; @@ -257,7 +220,7 @@ public void copied(Path fnameOrigin, Path fnameAdded) { if (needCopies) { if (matcher == null || matcher.accept(fnameAdded)) { - handler.handleStatus(new HgStatus(Kind.Added, fnameAdded, fnameOrigin)); + handler.handleStatus(new HgStatus(Added, fnameAdded, fnameOrigin)); } } } diff -r b92a638764be -r 2e395db595e2 test/org/tmatesoft/hg/test/TestStatus.java --- a/test/org/tmatesoft/hg/test/TestStatus.java Tue Feb 15 07:03:14 2011 +0100 +++ b/test/org/tmatesoft/hg/test/TestStatus.java Wed Feb 16 18:42:10 2011 +0100 @@ -17,7 +17,8 @@ package org.tmatesoft.hg.test; import static org.hamcrest.CoreMatchers.equalTo; -import static org.tmatesoft.hg.core.StatusCommand.HgStatus.Kind.*; +import static org.tmatesoft.hg.core.HgStatus.*; +import static org.tmatesoft.hg.core.HgStatus.Kind.*; import static org.tmatesoft.hg.repo.HgRepository.TIP; import java.util.Collection; @@ -31,10 +32,9 @@ import org.junit.Assume; import org.junit.Rule; import org.junit.Test; +import org.tmatesoft.hg.core.HgStatus; import org.tmatesoft.hg.core.Path; import org.tmatesoft.hg.core.StatusCommand; -import org.tmatesoft.hg.core.StatusCommand.HgStatus; -import org.tmatesoft.hg.core.StatusCommand.HgStatus.Kind; import org.tmatesoft.hg.repo.HgLookup; import org.tmatesoft.hg.repo.HgRepository; import org.tmatesoft.hg.repo.HgStatusCollector; @@ -126,7 +126,7 @@ } private static class StatusCollector implements StatusCommand.Handler { - private final Map> map = new TreeMap>(); + private final Map> map = new TreeMap>(); public void handleStatus(HgStatus s) { List l = map.get(s.getKind());