47 from .HgBackoutDialog import HgBackoutDialog |
47 from .HgBackoutDialog import HgBackoutDialog |
48 from .HgServeDialog import HgServeDialog |
48 from .HgServeDialog import HgServeDialog |
49 from .HgUtilities import getConfigPath |
49 from .HgUtilities import getConfigPath |
50 from .HgClient import HgClient |
50 from .HgClient import HgClient |
51 from .HgImportDialog import HgImportDialog |
51 from .HgImportDialog import HgImportDialog |
|
52 from .HgExportDialog import HgExportDialog |
52 |
53 |
53 from .BookmarksExtension.bookmarks import Bookmarks |
54 from .BookmarksExtension.bookmarks import Bookmarks |
54 from .QueuesExtension.queues import Queues |
55 from .QueuesExtension.queues import Queues |
55 from .FetchExtension.fetch import Fetch |
56 from .FetchExtension.fetch import Fetch |
56 from .PurgeExtension.purge import Purge |
57 from .PurgeExtension.purge import Purge |
2428 else: |
2429 else: |
2429 res = False |
2430 res = False |
2430 |
2431 |
2431 return res |
2432 return res |
2432 |
2433 |
|
2434 def hgExport(self, name): |
|
2435 """ |
|
2436 Public method to export patches to files. |
|
2437 |
|
2438 @param name directory name of the project to export from (string) |
|
2439 """ |
|
2440 dname, fname = self.splitPath(name) |
|
2441 |
|
2442 # find the root of the repo |
|
2443 repodir = dname |
|
2444 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
2445 repodir = os.path.dirname(repodir) |
|
2446 if repodir == os.sep: |
|
2447 return |
|
2448 |
|
2449 dlg = HgExportDialog() |
|
2450 if dlg.exec_() == QDialog.Accepted: |
|
2451 filePattern, revisions, switchParent, allText, noDates, git = \ |
|
2452 dlg.getParameters() |
|
2453 |
|
2454 args = [] |
|
2455 args.append("export") |
|
2456 args.append("--output") |
|
2457 args.append(filePattern) |
|
2458 args.append("--verbose") |
|
2459 if switchParent: |
|
2460 args.append("--switch-parent") |
|
2461 if allText: |
|
2462 args.append("--text") |
|
2463 if noDates: |
|
2464 args.append("--nodates") |
|
2465 if git: |
|
2466 args.append("--git") |
|
2467 for rev in revisions: |
|
2468 args.append(rev) |
|
2469 |
|
2470 dia = HgDialog(self.trUtf8("Export Patches"), self) |
|
2471 res = dia.startProcess(args, repodir) |
|
2472 if res: |
|
2473 dia.exec_() |
|
2474 |
2433 ############################################################################ |
2475 ############################################################################ |
2434 ## Methods to handle extensions are below. |
2476 ## Methods to handle extensions are below. |
2435 ############################################################################ |
2477 ############################################################################ |
2436 |
2478 |
2437 def __iniFileChanged(self, path): |
2479 def __iniFileChanged(self, path): |