Hg: Improve push/pull handling

* Use paths/default-push and paths/default Urls as appropriate
* Read the settings from the project location except when the
  currently open file is not below that project directory.

  This makes things work for QTCREATORBUG-10261 without breaking
  .hgsubs (which are required to be children of the top-level
  repository.

Task-number: QTCREATORBUG-10261
Change-Id: Ie7cc4b9a420f17e27b69eae93fb9985e1a218d6e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2014-02-24 14:16:12 +01:00
parent c2803b00be
commit f6aba96197
3 changed files with 33 additions and 10 deletions

View File

@@ -439,11 +439,11 @@ void MercurialPlugin::pull()
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
SrcDestDialog dialog;
SrcDestDialog dialog(SrcDestDialog::incoming);
dialog.setWindowTitle(tr("Pull Source"));
if (dialog.exec() != QDialog::Accepted)
return;
m_client->synchronousPull(state.topLevel(), dialog.getRepositoryString());
m_client->synchronousPull(dialog.workingDir(), dialog.getRepositoryString());
}
void MercurialPlugin::push()
@@ -451,11 +451,11 @@ void MercurialPlugin::push()
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
SrcDestDialog dialog;
SrcDestDialog dialog(SrcDestDialog::outgoing);
dialog.setWindowTitle(tr("Push Destination"));
if (dialog.exec() != QDialog::Accepted)
return;
m_client->synchronousPush(state.topLevel(), dialog.getRepositoryString());
m_client->synchronousPush(dialog.workingDir(), dialog.getRepositoryString());
}
void MercurialPlugin::update()
@@ -491,7 +491,7 @@ void MercurialPlugin::incoming()
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
SrcDestDialog dialog;
SrcDestDialog dialog(SrcDestDialog::incoming);
dialog.setWindowTitle(tr("Incoming Source"));
if (dialog.exec() != QDialog::Accepted)
return;