Ejemplo n.º 1
0
void HgUpdateDialog::slotUpdateDialog(int index)
{
    HgWrapper *hgWrapper = HgWrapper::instance();
    m_selectFinal->clear();
    if (index == 0) {
        m_updateTo = ToBranch;
        m_selectFinal->setEditable(false);
        m_selectFinal->addItems(hgWrapper->getBranches());
    }
    else if (index == 1) {
        m_updateTo = ToTag;
        m_selectFinal->setEditable(false);
        m_selectFinal->addItems(hgWrapper->getTags());
    }
    else if (index == 2) {
        m_updateTo = ToRevision;
        m_selectFinal->setEditable(true);
    }
    m_selectFinal->setFocus();

    /// get parents of current working directory
    /// more precise informtaion using 'hg summary'
    /// but no proper way to retrieve needed data
    QString output;
    QStringList args;
    args << QLatin1String("--template");
    args << QLatin1String("{rev}:{node|short} ({branch})\n");
    hgWrapper->executeCommand(QLatin1String("parents"), args, output);
    output.replace(QLatin1String("\n"), QLatin1String("<br/>"));
    if (output.contains(QLatin1String("()"))) {
        output.replace(QLatin1String("()"), QLatin1String("(default)"));
    }
    m_currentInfo->setText(output);
}