aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant - Mercurial Check-In/Out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant - Mercurial Check-In/Out" Watch "Ant - Mercurial Check-In/Out" New topic
Author

Ant - Mercurial Check-In/Out

Ramneek Singal
Greenhorn

Joined: Nov 20, 2013
Posts: 6
Hi,

We have moved from SVN to Mercurial. We used ant scripts to checkout and build the code out of SVN earlier. Now the question is how and what changes would I need to use the same scripts for checkout and build the code from mercurial?

I came across ant4hg but the download page has .tar.gz file for download so i guess it's not for windows.

Please advice?

Ramneek
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

You don't need any scripts. Any command you can execute on the command line can be executed from Ant. Have you used Ant before?
Ramneek Singal
Greenhorn

Joined: Nov 20, 2013
Posts: 6
Thanks for the reply Roger!

I got your point, I can use the <exec> tag to run any command I normally run on windows command line for hg. The other part of the problem is that I connect to a remote code repository, so I will have to authenticate first to run the hg commands; Below is an ant script for svn code, we have the dependency Jar entries and the classname - org.tmatesoft.svn.cli.SVN. What would be the corresponding Mercurial Jars and classname

Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

See these links, which talk about how to handle authentication and save the values so you don't have to include them in your script :

http://stackoverflow.com/questions/2584407/how-to-save-username-and-password-with-mercurial

http://hgtip.com/tips/advanced/2009-10-01-configuring-user-auth-https/

http://ebalaskas.gr/blog/2011/11/27/how-to-setup-http-authentication-on-a-mercurial-project/

http://blog.siliconvalve.com/2012/03/03/configure-mercurial-pull-with-http-authentication-for-jenkins-on-windows/
Ramneek Singal
Greenhorn

Joined: Nov 20, 2013
Posts: 6
Thanks Roger!! I have got the extention mercurial_keyring working.
 
 
subject: Ant - Mercurial Check-In/Out