9 |
9 |
10 import os |
10 import os |
11 import shutil |
11 import shutil |
12 |
12 |
13 from PyQt5.QtCore import ( |
13 from PyQt5.QtCore import ( |
14 QProcess, pyqtSignal, QFileInfo, QFileSystemWatcher, QCoreApplication |
14 pyqtSignal, QFileInfo, QFileSystemWatcher, QCoreApplication |
15 ) |
15 ) |
16 from PyQt5.QtWidgets import QApplication, QDialog, QInputDialog |
16 from PyQt5.QtWidgets import QApplication, QDialog, QInputDialog |
17 |
17 |
18 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Application import e5App |
19 from E5Gui import E5MessageBox, E5FileDialog |
19 from E5Gui import E5MessageBox, E5FileDialog |
3454 @return list of bookmarks (list of string) |
3454 @return list of bookmarks (list of string) |
3455 """ |
3455 """ |
3456 args = self.initCommand("bookmarks") |
3456 args = self.initCommand("bookmarks") |
3457 |
3457 |
3458 client = self.getClient() |
3458 client = self.getClient() |
3459 output = "" |
3459 output = client.runcommand(args)[0] |
3460 if client: |
|
3461 output = client.runcommand(args)[0] |
|
3462 else: |
|
3463 process = QProcess() |
|
3464 process.setWorkingDirectory(repodir) |
|
3465 process.start('hg', args) |
|
3466 procStarted = process.waitForStarted(5000) |
|
3467 if procStarted: |
|
3468 finished = process.waitForFinished(30000) |
|
3469 if finished and process.exitCode() == 0: |
|
3470 output = str(process.readAllStandardOutput(), |
|
3471 self.getEncoding(), 'replace') |
|
3472 |
3460 |
3473 self.bookmarksList = [] |
3461 self.bookmarksList = [] |
3474 for line in output.splitlines(): |
3462 for line in output.splitlines(): |
3475 li = line.strip().split() |
3463 li = line.strip().split() |
3476 if li[-1][0] in "1234567890": |
3464 if li[-1][0] in "1234567890": |
3671 else: |
3659 else: |
3672 args = self.initCommand("outgoing") |
3660 args = self.initCommand("outgoing") |
3673 args.append('--bookmarks') |
3661 args.append('--bookmarks') |
3674 |
3662 |
3675 client = self.getClient() |
3663 client = self.getClient() |
3676 output = "" |
3664 output = client.runcommand(args)[0] |
3677 if client: |
|
3678 output = client.runcommand(args)[0] |
|
3679 else: |
|
3680 process = QProcess() |
|
3681 process.setWorkingDirectory(repodir) |
|
3682 process.start('hg', args) |
|
3683 procStarted = process.waitForStarted(5000) |
|
3684 if procStarted: |
|
3685 finished = process.waitForFinished(30000) |
|
3686 if finished and process.exitCode() == 0: |
|
3687 output = str(process.readAllStandardOutput(), |
|
3688 self.getEncoding(), 'replace') |
|
3689 |
3665 |
3690 for line in output.splitlines(): |
3666 for line in output.splitlines(): |
3691 if line.startswith(" "): |
3667 if line.startswith(" "): |
3692 li = line.strip().split() |
3668 li = line.strip().split() |
3693 del li[-1] |
3669 del li[-1] |