how to run hg recover command on a remote repository
Asked Answered
B

4

5

I am getting the following error while running build in teamcity.

Failed to collect changes, error: '"C:\Program Files\TortoiseHg\hg.exe" --config ui.interactive=False pull https://test:******@hg.myrepo.co.uk/terriff' command failed.
stdout: pulling from https://test:***@hg.myrepo.co.uk/terriff
searching for changes

stderr: abort: abandoned transaction found - run hg recover!

I already tried to delete the build directories on agent machines but still getting same error. Also tried to run hg recover command but it says repository is not local. Please guide how to fix this error.

Backsight answered 18/3, 2013 at 11:27 Comment(0)
E
-1

Yeah, that command will have to be run on the remote host (for example, via a shell).

Ehrenburg answered 19/3, 2013 at 13:25 Comment(0)
N
5

I have the same issue, because my hg folder was missing from the repository folder. I managed to fix it running hg recover on the cached version of the repository. You can find the cached repository at the following directory:

..\ProgramData\JetBrains\TeamCity\system\caches\mercurial

You should see a few folders with the names like hg_7282240431393414416 and a file map(with no extension) at that folder. There are mappings from repository to folders stored in this file. The file contains a few lines like:

https://bitbucket.org/{teamname1}/{repo1}/ = hg_7282240431393414416
https://bitbucket.org/{teamname1}/{repo2}/ = hg_7282240431393414417
https://bitbucket.org/{teamname2}/{repo3}/ = hg_7282240431393414418

You have to find the folder corresponding to your repository(after the equation sign) in this map file and run hg recover in that corresponding folder. Running this command may take some time.

Please, note: team names, repositories and folder names are for demonstration only.

I hope it will help!

Nagari answered 2/6, 2015 at 10:33 Comment(1)
..\ProgramData\JetBrains\TeamCity\system\caches\mercurial is the default location, in our case we had set the cache location elsewhere, which foxed us for a bit.Hesione
C
3

Ok, I faced the same issue today and this is how I fixed it!

  1. If you are running it in Windows, then open Command Prompt.
  2. Type,

    hg recover -R "remote-path-of-your-repository"

  3. It might take a while until the command completes.

Clower answered 29/7, 2014 at 6:58 Comment(1)
For me, this resulted in: "abort: repository '<remote-path-of-your-repository' is not local". GoogleHireMe's answer was right for me.Jelks
M
0

I got the same issue and i fixed this by trashing the cache/mercurial directory of TEAMCITY. It may be not the best thing to do, but it's now working. The problem with HG comes from one of the subfolders of team citycache...

I took me about 5 hours to understand it! Damn!

Malvin answered 13/2, 2015 at 22:15 Comment(1)
I get this too, posted a bug for TeamCity: youtrack.jetbrains.com/issue/TW-43492Gilbertine
E
-1

Yeah, that command will have to be run on the remote host (for example, via a shell).

Ehrenburg answered 19/3, 2013 at 13:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.