# HG changeset patch # User Andreas Eisele # Date 1696933948 -7200 # Node ID 1a43a8c758a40772f606b298a369d43b54d63af6 # Parent 54472aa4b7b20f9f578b07690ebeb60de8f02948 TW-83599: recognize "path contains illegal component" error and retry pull command with explicit revision, agent side logic diff -r 54472aa4b7b2 -r 1a43a8c758a4 mercurial-agent/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialIncludeRuleUpdater.java --- a/mercurial-agent/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialIncludeRuleUpdater.java Tue Oct 10 12:11:40 2023 +0200 +++ b/mercurial-agent/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialIncludeRuleUpdater.java Tue Oct 10 12:32:28 2023 +0200 @@ -161,18 +161,17 @@ } } - private void doPull(@NotNull HgRepo repo, @NotNull String repositoryUrl, @Nullable String revision) throws VcsException { + private void doPull(@NotNull HgRepo repo, @NotNull String repositoryUrl, @NotNull String revision) throws VcsException { doPull(repo, repositoryUrl, revision, false); } - private void doPull(@NotNull HgRepo repo, @NotNull String repositoryUrl, @Nullable String revision, boolean explicitRevision) throws VcsException { - final String effectiveRevision = revision != null ? revision : "tip"; + private void doPull(@NotNull HgRepo repo, @NotNull String repositoryUrl, @NotNull String revision, boolean explicitRevision) throws VcsException { final PullCommand pullCommand = repo.pull().fromRepository(repositoryUrl) .withTraceback(myUseTraceback) .withProfile(myProfile) .withTimeout(myPullTimeout); if (explicitRevision) { - pullCommand.withNamedRevision(effectiveRevision); + pullCommand.withNamedRevision(revision); } try { @@ -181,7 +180,7 @@ if (!myRetryPullForIllegalPathComponent || explicitRevision) { throw e; } - myLogger.message("Pull encountered illegal path component " + e.getComponent() + " retrying with explicit revision " + effectiveRevision); + myLogger.message("Pull encountered illegal path component " + e.getComponent() + " retrying with explicit revision " + revision); doPull(repo, repositoryUrl, revision, true); } }