13 |
13 |
14 from PyQt4.QtCore import QProcess, SIGNAL |
14 from PyQt4.QtCore import QProcess, SIGNAL |
15 from PyQt4.QtGui import QMessageBox, QApplication, QDialog, QInputDialog |
15 from PyQt4.QtGui import QMessageBox, QApplication, QDialog, QInputDialog |
16 |
16 |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
|
18 |
|
19 from QScintilla.MiniEditor import MiniEditor |
18 |
20 |
19 from VCS.VersionControl import VersionControl |
21 from VCS.VersionControl import VersionControl |
20 from VCS.RepositoryInfoDialog import VcsRepositoryInfoDialog |
22 from VCS.RepositoryInfoDialog import VcsRepositoryInfoDialog |
21 |
23 |
22 from .HgDialog import HgDialog |
24 from .HgDialog import HgDialog |
1468 dia = HgDialog(self.trUtf8('Creating branch in the Mercurial repository')) |
1471 dia = HgDialog(self.trUtf8('Creating branch in the Mercurial repository')) |
1469 res = dia.startProcess(args, repodir) |
1472 res = dia.startProcess(args, repodir) |
1470 if res: |
1473 if res: |
1471 dia.exec_() |
1474 dia.exec_() |
1472 |
1475 |
|
1476 def hgEditConfig(self, name): |
|
1477 """ |
|
1478 Public method used to edit the repository config file. |
|
1479 |
|
1480 @param name file/directory name (string) |
|
1481 """ |
|
1482 dname, fname = self.splitPath(name) |
|
1483 |
|
1484 # find the root of the repo |
|
1485 repodir = str(dname) |
|
1486 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
1487 repodir = os.path.dirname(repodir) |
|
1488 if repodir == os.sep: |
|
1489 return |
|
1490 |
|
1491 cfgFile = os.path.join(repodir, self.adminDir, "hgrc") |
|
1492 self.editor = MiniEditor(cfgFile, "Properties") |
|
1493 self.editor.show() |
|
1494 |
|
1495 def hgVerify(self, name): |
|
1496 """ |
|
1497 Public method to verify the integrity of the repository. |
|
1498 |
|
1499 @param name file/directory name (string) |
|
1500 """ |
|
1501 dname, fname = self.splitPath(name) |
|
1502 |
|
1503 # find the root of the repo |
|
1504 repodir = str(dname) |
|
1505 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
1506 repodir = os.path.dirname(repodir) |
|
1507 if repodir == os.sep: |
|
1508 return |
|
1509 |
|
1510 args = [] |
|
1511 args.append('verify') |
|
1512 |
|
1513 dia = HgDialog(self.trUtf8('Verifying the integrity of the Mercurial repository')) |
|
1514 res = dia.startProcess(args, repodir) |
|
1515 if res: |
|
1516 dia.exec_() |
|
1517 |
|
1518 def hgShowConfig(self, name): |
|
1519 """ |
|
1520 Public method to show the combined config. |
|
1521 |
|
1522 @param name file/directory name (string) |
|
1523 """ |
|
1524 dname, fname = self.splitPath(name) |
|
1525 |
|
1526 # find the root of the repo |
|
1527 repodir = str(dname) |
|
1528 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
1529 repodir = os.path.dirname(repodir) |
|
1530 if repodir == os.sep: |
|
1531 return |
|
1532 |
|
1533 args = [] |
|
1534 args.append('showconfig') |
|
1535 args.append("--untrusted") |
|
1536 |
|
1537 dia = HgDialog(self.trUtf8('Showing the combined configuration settings')) |
|
1538 res = dia.startProcess(args, repodir, False) |
|
1539 if res: |
|
1540 dia.exec_() |
|
1541 |
|
1542 def hgShowPaths(self, name): |
|
1543 """ |
|
1544 Public method to show the path aliases for remote repositories. |
|
1545 |
|
1546 @param name file/directory name (string) |
|
1547 """ |
|
1548 dname, fname = self.splitPath(name) |
|
1549 |
|
1550 # find the root of the repo |
|
1551 repodir = str(dname) |
|
1552 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
1553 repodir = os.path.dirname(repodir) |
|
1554 if repodir == os.sep: |
|
1555 return |
|
1556 |
|
1557 args = [] |
|
1558 args.append('paths') |
|
1559 |
|
1560 dia = HgDialog(self.trUtf8('Showing aliases for remote repositories')) |
|
1561 res = dia.startProcess(args, repodir, False) |
|
1562 if res: |
|
1563 dia.exec_() |
|
1564 |
|
1565 def hgRecover(self, name): |
|
1566 """ |
|
1567 Public method to recover an interrupted transaction. |
|
1568 |
|
1569 @param name file/directory name (string) |
|
1570 """ |
|
1571 dname, fname = self.splitPath(name) |
|
1572 |
|
1573 # find the root of the repo |
|
1574 repodir = str(dname) |
|
1575 while not os.path.isdir(os.path.join(repodir, self.adminDir)): |
|
1576 repodir = os.path.dirname(repodir) |
|
1577 if repodir == os.sep: |
|
1578 return |
|
1579 |
|
1580 args = [] |
|
1581 args.append('recover') |
|
1582 |
|
1583 dia = HgDialog(self.trUtf8('Recovering from interrupted transaction')) |
|
1584 res = dia.startProcess(args, repodir, False) |
|
1585 if res: |
|
1586 dia.exec_() |
|
1587 |
1473 ############################################################################ |
1588 ############################################################################ |
1474 ## Methods to get the helper objects are below. |
1589 ## Methods to get the helper objects are below. |
1475 ############################################################################ |
1590 ############################################################################ |
1476 |
1591 |
1477 def vcsGetProjectBrowserHelper(self, browser, project, isTranslationsBrowser = False): |
1592 def vcsGetProjectBrowserHelper(self, browser, project, isTranslationsBrowser = False): |