Question

I have set up a local jenkins with mercurial plug in that should clone a local repository, i.e. Repository URL = C:\repo is a local path. I work on a branch, that's why I also added branch = myBranchName, but I don't believe this causes my problems.

If I start the job an error occurs and in the console I find (translated by me)

started by user anonymous
Building in workspace C:\jenkins\jobs\LocalRepo\workspace
$ hg clone --rev myBranchName --noupdate C:\repo C:\jenkins\jobs\LocalRepo\workspace
adding changesets
adding manifests
adding file changes
added 7905 changesets with 42182 changes to 10043 files
[workspace] $ hg update --rev myBranchName
abort: C:\jenkins\jobs\LocalRepo\workspace\Server/src/main/resources/com/application/resources/FileWithReallyReallyReallyReallyLongFileName.properties: The system cannot find the given path
ERROR: Failed to update C:\repo to rev myBranchName
Finished: FAILURE

I can reproduce the error in the command console with mercurial (translated again):

/cygdrive/c/jenkins/jobs/LocalRepo/workspace $ hg branch
default
/cygdrive/c/jenkins/jobs/LocalRepo/workspace $ hg hg update -C
Cancel: C:\jenkins\jobs\LocalRepo\workspace\Server/src/main/resources/com/application/resources/FileWithReallyReallyReallyReallyLongFileName.properties: The system cannot find the given path

The file really exists under C:\repo but not under the cloned directory C:\jenkins\jobs\LocalRepo\workspace.

What am I doing wrong? The absolute path is in my real application 269 chars long. Is that really the problem? Is that no problem for mercurial in the real repository C:\repo because jenkins writes the file in the deeper and longer path C:\jenkins\jobs\LocalRepo\workspace\? If that really is the problem how could I solve it best?

Was it helpful?

Solution

The absolute path is in my real application 269 chars long. Is that really the problem

Yes. The maximum path length in Windows is 260 characters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top