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

Merge with stable

Changeset 2e92e61698ed

Parents bcfafe423cfd

Parents 8d237f16ab5d

by Steve Borho

Changes to one file · Browse files at 2e92e61698ed Showing diff from parent bcfafe423cfd 8d237f16ab5d Diff from another changeset...

 
1311
1312
1313
 
1314
1315
 
 
1316
 
 
 
 
 
 
 
 
 
 
 
1317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1318
1319
1320
 
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
@@ -1311,10 +1311,53 @@
  return   epath = os.path.join(hglib.fromunicode(dir),   hglib.fromunicode(self.repo.shortname)+'_%r.patch') +   cmdline = ['export', '--repository', self.repo.root, '--verbose',   '--output', epath] + + existingRevisions = []   for rev in revisions: + if os.path.exists(epath % rev): + if os.path.isfile(epath % rev): + existingRevisions.append(rev) + else: + QMessageBox.warning(self, + _('Cannot export revision'), + (_('Cannot export revision %s into the file named:' + '\n\n%s\n') % (rev, epath % rev)) + \ + _('There is already an existing folder ' + 'with that same name.')) + return   cmdline.extend(['--rev', str(rev)]) + + if existingRevisions: + buttonNames = [_("Replace"), _("Append"), _("Abort")] + + warningMessage = \ + _('There are existing patch files for %d revisions (%s) ' + 'in the selected location (%s).\n\n') \ + % (len(existingRevisions), + " ,".join([str(rev) for rev in existingRevisions]), + dir) + + warningMessage += \ + _('What do you want to do?\n') + u'\n' + \ + u'- ' + _('Replace the existing patch files.\n') + \ + u'- ' + _('Append the changes to the existing patch files.\n') + \ + u'- ' + _('Abort the export operation.\n') + + res = qtlib.CustomPrompt(_('Patch files already exist'), + warningMessage, + self, + buttonNames, 0, 2).run() + + if buttonNames[res] == _("Replace"): + # Remove the existing patch files + for rev in existingRevisions: + os.remove(epath % rev) + elif buttonNames[res] == _("Abort"): + return +   self.runCommand(cmdline)     def visualDiffRevision(self):