Repository refresh added after pull action

* HgRepository used instead of VirtualFile in PullAction;
* annotations added
This commit is contained in:
Nadya Zabrodina
2014-05-07 15:23:46 +04:00
parent 8e41d7dce0
commit bf339b610e
2 changed files with 12 additions and 11 deletions
@@ -35,23 +35,23 @@ public class HgPullAction extends HgAbstractGlobalAction {
dialog.show();
if (dialog.isOK()) {
dialog.rememberSettings();
new Task.Backgroundable(project, "Pulling changes from " + dialog.getSource(), false) {
final String source = dialog.getSource();
final HgRepository hgRepository = dialog.getRepository();
new Task.Backgroundable(project, "Pulling changes from " + source, false) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
executePull(dialog, project);
markDirtyAndHandleErrors(project, dialog.getRepository());
executePull(project, hgRepository, source);
markDirtyAndHandleErrors(project, hgRepository.getRoot());
}
}.queue();
}
}
private static void executePull(final HgPullDialog dialog, final Project project) {
final HgPullCommand command = new HgPullCommand(
project, dialog.getRepository()
);
command.setSource(dialog.getSource());
private static void executePull(final Project project, final HgRepository hgRepository, final String source) {
final HgPullCommand command = new HgPullCommand(project, hgRepository.getRoot());
command.setSource(source);
command.execute();
hgRepository.update();
}
}
@@ -82,8 +82,9 @@ public class HgPullDialog extends DialogWrapper {
rememberedInputs.addUrl(HgUtil.removePasswordIfNeeded(getSource()));
}
public VirtualFile getRepository() {
return hgRepositorySelector.getRepository().getRoot();
@NotNull
public HgRepository getRepository() {
return hgRepositorySelector.getRepository();
}
public String getSource() {