Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1.1, 2.1.2, and tip

stable export: show message after export, with a link to the export folder and patch

When a single revision is exported, the information message contains a link
to the export folder and a link to the patch file itself.

When multiple revisions are exported, the export count is shown plus a link
to the export folder.

Note that this does not check whether the export operation was successful, since
there is no easy way to get that information.

Changeset f4071882041d

Parent 666e5533116b

by Angel Ezquerra

Changes to one file · Browse files at f4071882041d Showing diff from parent 666e5533116b Diff from another changeset...

 
1413
1414
1415
1416
 
1417
1418
 
1419
1420
 
 
1421
1422
1423
 
1446
1447
1448
1449
 
1450
1451
1452
 
1468
1469
1470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1471
1472
1473
 
1413
1414
1415
 
1416
1417
 
1418
1419
 
1420
1421
1422
1423
1424
 
1447
1448
1449
 
1450
1451
1452
1453
 
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
@@ -1413,11 +1413,12 @@
  def exportRevisions(self, revisions):   if not revisions:   revisions = [self.rev] - dir = QFileDialog.getExistingDirectory(self, _('Export patch'), + udir = QFileDialog.getExistingDirectory(self, _('Export patch'),   hglib.tounicode(self.repo.root)) - if not dir: + if not udir:   return - epath = os.path.join(hglib.fromunicode(dir), + strdir = hglib.fromunicode(udir) + epath = os.path.join(strdir,   hglib.fromunicode(self.repo.shortname)+'_%r.patch')     cmdline = ['export', '--repository', self.repo.root, '--verbose', @@ -1446,7 +1447,7 @@
  'in the selected location (%s).\n\n') \   % (len(existingRevisions),   " ,".join([str(rev) for rev in existingRevisions]), - dir) + udir)     warningMessage += \   _('What do you want to do?\n') + u'\n' + \ @@ -1468,6 +1469,29 @@
    self.runCommand(cmdline)   + if len(revisions) == 1: + # Show a message box with a link to the export folder and to the + # exported file + rev = revisions[0] + patchfilename = os.path.normpath(epath % rev) + patchdirname = os.path.normpath(strdir) + patchshortname = os.path.basename(patchfilename) + qtlib.InfoMsgBox(_('Patch exported'), + _('Revision #%d (%s) was exported to:<p>' + '<a href="file:///%s">%s</a>%s' + '<a href="file:///%s">%s</a>') \ + % (rev, str(self.repo[rev]), + patchdirname, patchdirname, os.path.sep, + patchfilename, patchshortname)) + else: + # Show a message box with a link to the export folder + qtlib.InfoMsgBox(_('Patches exported'), + _('%d patches were exported to:<p>' + '<a href="file:///%s">%s</a>') \ + % (len(revisions), + strdir, + strdir)) +   def visualDiffRevision(self):   opts = dict(change=self.rev)   dlg = visdiff.visualdiff(self.repo.ui, self.repo, [], opts)