fix bug in HgRepositoryClient

This commit is contained in:
Sebastian Sdorra
2011-10-19 13:34:35 +02:00
parent 47b9b0d42f
commit 5467fc97e0

View File

@@ -133,11 +133,16 @@ public class HgRepositoryClient extends AbstractRepositoryClient
@Override
public void commit(String message) throws RepositoryClientException
{
SimpleCommand cmd = new SimpleCommand(hg, "-R",
localRepository.getAbsolutePath(), "commit", "-m",
message);
SimpleCommand cmd = null;
if (pendingCommit)
{
cmd = new SimpleCommand(hg, "-R", localRepository.getAbsolutePath(),
"commit", "-m", message);
execute(cmd);
pendingCommit = false;
}
execute(cmd);
cmd = new SimpleCommand(hg, "-R", localRepository.getAbsolutePath(),
"push", remoteURL);
execute(cmd);
@@ -173,6 +178,7 @@ public class HgRepositoryClient extends AbstractRepositoryClient
new File(localRepository, file).getAbsolutePath());
execute(cmd);
pendingCommit = true;
}
/**
@@ -218,6 +224,9 @@ public class HgRepositoryClient extends AbstractRepositoryClient
/** Field description */
private String hg;
/** Field description */
private boolean pendingCommit = false;
/** Field description */
private String remoteURL;
}