# HG changeset patch # User Pavel.Sher # Date 1374679493 -7200 # Node ID f8b61c31bf201d1641e3029ccb8c3ef8db9bb0a9 # Parent 86e18788296056fd579acaa3a4533997e9711cd1 TW-30920 - never use path returned by CheckoutRules map() method + fix in exception handle1 diff -r 86e187882960 -r f8b61c31bf20 mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java --- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java Fri Jun 28 12:06:09 2013 +0400 +++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialCollectChangesPolicy.java Wed Jul 24 17:24:53 2013 +0200 @@ -263,8 +263,7 @@ @NotNull CheckoutRules rules) { List files = new ArrayList(0); for (FileStatus mf: modifiedFiles) { - String path = rules.map(mf.getPath()); - if (!shouldInclude(path)) + if (rules.map(mf.getPath()) == null) continue; String normalizedPath = PathUtil.normalizeSeparator(mf.getPath()); VcsChangeInfo.Type changeType = getChangeType(mf.getStatus()); @@ -272,7 +271,8 @@ Loggers.VCS.warn("Unable to convert status: " + mf.getStatus() + " to VCS change type"); changeType = VcsChangeInfo.Type.NOT_CHANGED; } - files.add(new VcsChange(changeType, mf.getStatus().getName(), ctx.getStringFromPool(normalizedPath), ctx.getStringFromPool(path), prevVer, curVer)); + String path = ctx.getStringFromPool(normalizedPath); + files.add(new VcsChange(changeType, mf.getStatus().getName(), path, path, prevVer, curVer)); } if (files.isEmpty()) return emptyList(); @@ -280,11 +280,6 @@ } - private boolean shouldInclude(String path) { - return path != null; - } - - private VcsChangeInfo.Type getChangeType(final Status status) { switch (status) { case ADDED:return VcsChangeInfo.Type.ADDED; @@ -407,7 +402,7 @@ attributes.putAll(attrBuilder.buildAttributes()); } catch (Exception e) { Loggers.VCS.warn("Error while reporting subrepo config changes", e); - if (e instanceof VcsExtension) + if (e instanceof VcsException) throw (VcsException) e; throw new VcsException(e); }