added auto configuration button to mercurial config panel

This commit is contained in:
Sebastian Sdorra
2011-01-07 16:34:20 +01:00
parent 2a407f65f7
commit 426f3fe525
3 changed files with 48 additions and 6 deletions

View File

@@ -78,6 +78,27 @@ public class HgConfigResource
this.handler = handler;
}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param uriInfo
*
* @return
*/
@POST
@Path("auto-configuration")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public HgConfig autoConfiguration(@Context UriInfo uriInfo)
{
handler.setConfig(null);
handler.doAutoConfiguration();
return handler.getConfig();
}
//~--- get methods ----------------------------------------------------------
/**

View File

@@ -101,11 +101,8 @@ public class HgRepositoryHandler
* Method description
*
*/
@Override
public void loadConfig()
public void doAutoConfiguration()
{
super.loadConfig();
HgInstaller installer = null;
if (SystemUtil.isWindows())
@@ -163,6 +160,17 @@ public class HgRepositoryHandler
storeConfig();
}
/**
* Method description
*
*/
@Override
public void loadConfig()
{
super.loadConfig();
doAutoConfiguration();
}
//~--- get methods ----------------------------------------------------------
/**