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 from .HgExportDialog import HgExportDialog |
53 from .HgPhaseDialog import HgPhaseDialog |
53 from .HgPhaseDialog import HgPhaseDialog |
|
54 from .HgGraftDialog import HgGraftDialog |
54 |
55 |
55 from .BookmarksExtension.bookmarks import Bookmarks |
56 from .BookmarksExtension.bookmarks import Bookmarks |
56 from .QueuesExtension.queues import Queues |
57 from .QueuesExtension.queues import Queues |
57 from .FetchExtension.fetch import Fetch |
58 from .FetchExtension.fetch import Fetch |
58 from .PurgeExtension.purge import Purge |
59 from .PurgeExtension.purge import Purge |
2523 else: |
2524 else: |
2524 res = False |
2525 res = False |
2525 |
2526 |
2526 return res |
2527 return res |
2527 |
2528 |
|
2529 def hgGraft(self, path): |
|
2530 """ |
|
2531 Public method to copy changesets from another branch. |
|
2532 |
|
2533 @param path directory name of the project (string) |
|
2534 @return flag indicating that the project should be reread (boolean) |
|
2535 """ |
|
2536 # find the root of the repo |
|
2537 repodir = self.splitPath(path)[0] |
|
2538 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
2539 repodir = os.path.dirname(repodir) |
|
2540 if os.path.splitdrive(repodir)[1] == os.sep: |
|
2541 return False |
|
2542 |
|
2543 res = False |
|
2544 dlg = HgGraftDialog() |
|
2545 if dlg.exec_() == QDialog.Accepted: |
|
2546 revs, (userData, currentUser, userName), \ |
|
2547 (dateData, currentDate, dateStr) = dlg.getData() |
|
2548 |
|
2549 args = [] |
|
2550 args.append("graft") |
|
2551 args.append("--verbose") |
|
2552 if userData: |
|
2553 if currentUser: |
|
2554 args.append("--currentuser") |
|
2555 else: |
|
2556 args.append("--user") |
|
2557 args.append(userName) |
|
2558 if dateData: |
|
2559 if currentDate: |
|
2560 args.append("--currentdate") |
|
2561 else: |
|
2562 args.append("--date") |
|
2563 args.append(dateStr) |
|
2564 args.extend(revs) |
|
2565 |
|
2566 dia = HgDialog(self.trUtf8('Copy Changesets'), self) |
|
2567 res = dia.startProcess(args, repodir) |
|
2568 if res: |
|
2569 dia.exec_() |
|
2570 res = dia.hasAddOrDelete() |
|
2571 self.checkVCSStatus() |
|
2572 return res |
|
2573 |
|
2574 def hgGraftContinue(self, path): |
|
2575 """ |
|
2576 Public method to continue copying changesets from another branch. |
|
2577 |
|
2578 @param path directory name of the project (string) |
|
2579 @return flag indicating that the project should be reread (boolean) |
|
2580 """ |
|
2581 # find the root of the repo |
|
2582 repodir = self.splitPath(path)[0] |
|
2583 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
2584 repodir = os.path.dirname(repodir) |
|
2585 if os.path.splitdrive(repodir)[1] == os.sep: |
|
2586 return |
|
2587 |
|
2588 args = [] |
|
2589 args.append("graft") |
|
2590 args.append("--continue") |
|
2591 args.append("--verbose") |
|
2592 |
|
2593 dia = HgDialog(self.trUtf8('Copy Changesets (Continue)'), self) |
|
2594 res = dia.startProcess(args, repodir) |
|
2595 if res: |
|
2596 dia.exec_() |
|
2597 res = dia.hasAddOrDelete() |
|
2598 self.vcs.checkVCSStatus() |
|
2599 return res |
|
2600 |
2528 ############################################################################ |
2601 ############################################################################ |
2529 ## Methods to handle extensions are below. |
2602 ## Methods to handle extensions are below. |
2530 ############################################################################ |
2603 ############################################################################ |
2531 |
2604 |
2532 def __iniFileChanged(self, path): |
2605 def __iniFileChanged(self, path): |