Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build problem: Hg repository not found
Stellorion
#1 Posted : Wednesday, January 18, 2012 2:39:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/18/2012(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi,

Using the last version on VS 2010, I have the following build error:

(126): Mercurial command "hg.exe identify -n" exited with code -1.
abort: there is no Mercurial repository here (.hg not found)

This problem come from a special msBuild task that update version numbers based on the mercurial revision number. For that, I am using MSBuild Versioning Task I got on Codeplex. Basically, it seems that this task gets the Hg revision number by issuing the hg command on the repository the source is coming from.

As I understand where the problem is coming from, I am not able to find a workaround to bypass this problem, probably because I do not have a real understanding of the VS build process yet.

Regards,

Christophe
Remco
#2 Posted : Wednesday, January 18, 2012 6:32:43 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,975

Thanks: 929 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Christophe,

Thanks for posting. The best solution to this is definitely to disable your custom build step for NCrunch builds.

NCrunch sets a build property that can allow you to do this. You simply need to add a condition onto your custom build step. For example:

<Target Name="BeforeBuild">
<HgVersionFile TemplateFile="Properties\VersionInfo.base.cs"
DestinationFile="Properties\VersionInfo.cs" />
</Target>

... Should be changed to:

<Target Name="BeforeBuild" Condition="$(NCrunch) != '1'">
<HgVersionFile TemplateFile="Properties\VersionInfo.base.cs"
DestinationFile="Properties\VersionInfo.cs" />
</Target>

I'm keen to hear whether this solves your problem.


Cheers,

Remco
1 user thanked Remco for this useful post.
Stellorion on 1/18/2012(UTC)
Stellorion
#3 Posted : Wednesday, January 18, 2012 11:34:02 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/18/2012(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Remco,

Your workaround worked perfectly. Thank you for your quick answer, you can consider me as a fan of your porduct.

Regards,

Christophe
1 user thanked Stellorion for this useful post.
Remco on 1/19/2012(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.032 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download