comparison mainwindow.cpp @ 127:758471b71721

* Don't provide file list when committing, if the user didn't select files. Previously we (perhaps inadvertantly) used a list of all files because we had generated that for display -- but it breaks merge-commits and it's probably unwise to mess with very long command lines.
author Chris Cannam
date Mon, 29 Nov 2010 17:48:43 +0000
parents f41bbd0c7c27
children fcaf09ee825d
comparison
equal deleted inserted replaced
126:f41bbd0c7c27 127:758471b71721
301 { 301 {
302 QStringList params; 302 QStringList params;
303 QString comment; 303 QString comment;
304 304
305 QStringList files = hgTabs->getSelectedCommittableFiles(); 305 QStringList files = hgTabs->getSelectedCommittableFiles();
306 if (files.empty()) files = hgTabs->getAllCommittableFiles(); 306 QStringList reportFiles = files;
307 if (reportFiles.empty()) reportFiles = hgTabs->getAllCommittableFiles();
307 308
308 if (ConfirmCommentDialog::confirmAndGetLongComment 309 if (ConfirmCommentDialog::confirmAndGetLongComment
309 (this, 310 (this,
310 tr("Commit files"), 311 tr("Commit files"),
311 tr("<h3>Commit files</h3><p>You are about to commit the following files:"), 312 tr("<h3>Commit files</h3><p>You are about to commit the following files:"),
312 tr("<h3>Commit files</h3><p>You are about to commit %1 files."), 313 tr("<h3>Commit files</h3><p>You are about to commit %1 files."),
313 files, 314 reportFiles,
314 comment)) { 315 comment)) {
315 316
316 if ((justMerged == false) && //!!! review usage of justMerged, and how it interacts with asynchronous request queue 317 if ((justMerged == false) && //!!! review usage of justMerged, and how it interacts with asynchronous request queue
317 !files.empty()) { 318 !files.empty()) {
318 // User wants to commit selected file(s) (and this is not merge commit, which would fail if we selected files) 319 // User wants to commit selected file(s) (and this is not merge commit, which would fail if we selected files)
511 if (files.empty()) files = hgTabs->getAllRevertableFiles(); 512 if (files.empty()) files = hgTabs->getAllRevertableFiles();
512 513
513 if (ConfirmCommentDialog::confirmDangerousFilesAction 514 if (ConfirmCommentDialog::confirmDangerousFilesAction
514 (this, 515 (this,
515 tr("Revert files"), 516 tr("Revert files"),
516 tr("<h3>Revert files</h3><p>You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed."), 517 tr("<h3>Revert files</h3><p>You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed:"),
517 tr("<h3>Revert files</h3><p>You are about to <b>revert</b> %1 files.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed."), 518 tr("<h3>Revert files</h3><p>You are about to <b>revert</b> %1 files.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed."),
518 files)) { 519 files)) {
519 520
520 if (files.empty()) { 521 if (files.empty()) {
521 params << "revert" << "--no-backup"; 522 params << "revert" << "--no-backup";