815 bookmarksList = None |
815 bookmarksList = None |
816 |
816 |
817 from .HgMultiRevisionSelectionDialog import \ |
817 from .HgMultiRevisionSelectionDialog import \ |
818 HgMultiRevisionSelectionDialog |
818 HgMultiRevisionSelectionDialog |
819 dlg = HgMultiRevisionSelectionDialog( |
819 dlg = HgMultiRevisionSelectionDialog( |
820 self.hgGetTagsList(repodir), |
820 self.hgGetTagsList(repodir), |
821 self.hgGetBranchesList(repodir), |
821 self.hgGetBranchesList(repodir), |
822 bookmarksList, |
822 bookmarksList, |
823 emptyRevsOk=True, |
823 emptyRevsOk=True, |
824 showLimit=True, |
824 showLimit=True, |
825 limitDefault=self.getPlugin().getPreferences("LogLimit")) |
825 limitDefault=self.getPlugin().getPreferences("LogLimit")) |
826 if dlg.exec_() == QDialog.Accepted: |
826 if dlg.exec_() == QDialog.Accepted: |
827 revs, noEntries = dlg.getRevisions() |
827 revs, noEntries = dlg.getRevisions() |
828 from .HgLogDialog import HgLogDialog |
828 from .HgLogDialog import HgLogDialog |
829 self.log = HgLogDialog(self, isFile=isFile) |
829 self.log = HgLogDialog(self, isFile=isFile) |
830 self.log.show() |
830 self.log.show() |
1360 cdate, ctime = date.split()[:2] |
1360 cdate, ctime = date.split()[:2] |
1361 info = [] |
1361 info = [] |
1362 info.append(QApplication.translate( |
1362 info.append(QApplication.translate( |
1363 "mercurial", |
1363 "mercurial", |
1364 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
1364 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
1365 """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""")\ |
1365 """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""") |
1366 .format(index, changeset)) |
1366 .format(index, changeset)) |
1367 if tags: |
1367 if tags: |
1368 info.append(QApplication.translate( |
1368 info.append(QApplication.translate( |
1369 "mercurial", |
1369 "mercurial", |
1370 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
1370 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""") |
1371 .format('<br/>'.join(tags.split()))) |
1371 .format('<br/>'.join(tags.split()))) |
1372 if bookmarks: |
1372 if bookmarks: |
1373 info.append(QApplication.translate( |
1373 info.append(QApplication.translate( |
1374 "mercurial", |
1374 "mercurial", |
1375 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
1375 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""") |
1376 .format('<br/>'.join(bookmarks.split()))) |
1376 .format('<br/>'.join(bookmarks.split()))) |
1377 if branches: |
1377 if branches: |
1378 info.append(QApplication.translate( |
1378 info.append(QApplication.translate( |
1379 "mercurial", |
1379 "mercurial", |
1380 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
1380 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""") |
1381 .format('<br/>'.join(branches.split()))) |
1381 .format('<br/>'.join(branches.split()))) |
1382 info.append(QApplication.translate( |
1382 info.append(QApplication.translate( |
1383 "mercurial", |
1383 "mercurial", |
1384 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
1384 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
1385 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
1385 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
1386 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")\ |
1386 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""") |
1387 .format(author, cdate, ctime)) |
1387 .format(author, cdate, ctime)) |
1388 infoBlock.append("\n".join(info)) |
1388 infoBlock.append("\n".join(info)) |
1389 if infoBlock: |
1389 if infoBlock: |
1390 infoStr = """<tr></tr>{0}""".format("<tr></tr>".join(infoBlock)) |
1390 infoStr = """<tr></tr>{0}""".format("<tr></tr>".join(infoBlock)) |
1391 else: |
1391 else: |
1422 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" |
1422 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" |
1423 """<tr></tr>\n""" |
1423 """<tr></tr>\n""" |
1424 """<tr><td><b>URL</b></td><td>{1}</td></tr>\n""" |
1424 """<tr><td><b>URL</b></td><td>{1}</td></tr>\n""" |
1425 """{2}""" |
1425 """{2}""" |
1426 """</table></p>\n""" |
1426 """</table></p>\n""" |
1427 ).format(self.versionStr, url, infoStr) |
1427 ).format(self.versionStr, url, infoStr) |
1428 |
1428 |
1429 ########################################################################### |
1429 ########################################################################### |
1430 ## Private Mercurial specific methods are below. |
1430 ## Private Mercurial specific methods are below. |
1431 ########################################################################### |
1431 ########################################################################### |
1432 |
1432 |
1545 output, error = self.__client.runcommand(args) |
1545 output, error = self.__client.runcommand(args) |
1546 |
1546 |
1547 if output: |
1547 if output: |
1548 self.tagsList = [] |
1548 self.tagsList = [] |
1549 for line in output.splitlines(): |
1549 for line in output.splitlines(): |
1550 l = line.strip().split() |
1550 li = line.strip().split() |
1551 if l[-1][0] in "1234567890": |
1551 if li[-1][0] in "1234567890": |
1552 # last element is a rev:changeset |
1552 # last element is a rev:changeset |
1553 del l[-1] |
1553 del li[-1] |
1554 else: |
1554 else: |
1555 del l[-2:] |
1555 del li[-2:] |
1556 name = " ".join(l) |
1556 name = " ".join(li) |
1557 if name not in ["tip", "default"]: |
1557 if name not in ["tip", "default"]: |
1558 self.tagsList.append(name) |
1558 self.tagsList.append(name) |
1559 |
1559 |
1560 return self.tagsList[:] |
1560 return self.tagsList[:] |
1561 |
1561 |
1587 output, error = self.__client.runcommand(args) |
1587 output, error = self.__client.runcommand(args) |
1588 |
1588 |
1589 if output: |
1589 if output: |
1590 self.branchesList = [] |
1590 self.branchesList = [] |
1591 for line in output.splitlines(): |
1591 for line in output.splitlines(): |
1592 l = line.strip().split() |
1592 li = line.strip().split() |
1593 if l[-1][0] in "1234567890": |
1593 if li[-1][0] in "1234567890": |
1594 # last element is a rev:changeset |
1594 # last element is a rev:changeset |
1595 del l[-1] |
1595 del li[-1] |
1596 else: |
1596 else: |
1597 del l[-2:] |
1597 del li[-2:] |
1598 name = " ".join(l) |
1598 name = " ".join(li) |
1599 if name not in ["tip", "default"]: |
1599 if name not in ["tip", "default"]: |
1600 self.branchesList.append(name) |
1600 self.branchesList.append(name) |
1601 |
1601 |
1602 return self.branchesList[:] |
1602 return self.branchesList[:] |
1603 |
1603 |
1818 E5MessageBox.critical( |
1818 E5MessageBox.critical( |
1819 self.__ui, |
1819 self.__ui, |
1820 self.trUtf8("Mercurial Side-by-Side Difference"), |
1820 self.trUtf8("Mercurial Side-by-Side Difference"), |
1821 self.trUtf8( |
1821 self.trUtf8( |
1822 """<p>The file <b>{0}</b> could not be read.</p>""") |
1822 """<p>The file <b>{0}</b> could not be read.</p>""") |
1823 .format(name)) |
1823 .format(name)) |
1824 return |
1824 return |
1825 |
1825 |
1826 if self.sbsDiff is None: |
1826 if self.sbsDiff is None: |
1827 from UI.CompareDialog import CompareDialog |
1827 from UI.CompareDialog import CompareDialog |
1828 self.sbsDiff = CompareDialog() |
1828 self.sbsDiff = CompareDialog() |
2018 info.append(QApplication.translate( |
2018 info.append(QApplication.translate( |
2019 "mercurial", |
2019 "mercurial", |
2020 """<tr><td><b>Tip</b></td><td></td></tr>\n""")) |
2020 """<tr><td><b>Tip</b></td><td></td></tr>\n""")) |
2021 info.append(QApplication.translate( |
2021 info.append(QApplication.translate( |
2022 "mercurial", |
2022 "mercurial", |
2023 """<tr><td><b>Changeset</b></td><td>{0}</td></tr>""")\ |
2023 """<tr><td><b>Changeset</b></td><td>{0}</td></tr>""") |
2024 .format(changeset)) |
2024 .format(changeset)) |
2025 if tags: |
2025 if tags: |
2026 info.append(QApplication.translate( |
2026 info.append(QApplication.translate( |
2027 "mercurial", |
2027 "mercurial", |
2028 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
2028 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""") |
2029 .format('<br/>'.join(tags.split()))) |
2029 .format('<br/>'.join(tags.split()))) |
2030 if bookmarks: |
2030 if bookmarks: |
2031 info.append(QApplication.translate( |
2031 info.append(QApplication.translate( |
2032 "mercurial", |
2032 "mercurial", |
2033 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
2033 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""") |
2034 .format('<br/>'.join(bookmarks.split()))) |
2034 .format('<br/>'.join(bookmarks.split()))) |
2035 if branches: |
2035 if branches: |
2036 info.append(QApplication.translate( |
2036 info.append(QApplication.translate( |
2037 "mercurial", |
2037 "mercurial", |
2038 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
2038 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""") |
2039 .format('<br/>'.join(branches.split()))) |
2039 .format('<br/>'.join(branches.split()))) |
2040 if parents: |
2040 if parents: |
2041 info.append(QApplication.translate( |
2041 info.append(QApplication.translate( |
2042 "mercurial", |
2042 "mercurial", |
2043 """<tr><td><b>Parents</b></td><td>{0}</td></tr>""")\ |
2043 """<tr><td><b>Parents</b></td><td>{0}</td></tr>""") |
2044 .format('<br/>'.join(parents.split()))) |
2044 .format('<br/>'.join(parents.split()))) |
2045 info.append(QApplication.translate( |
2045 info.append(QApplication.translate( |
2046 "mercurial", |
2046 "mercurial", |
2047 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
2047 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
2048 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
2048 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
2049 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>\n""" |
2049 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>\n""" |
2050 """</table></p>""")\ |
2050 """</table></p>""") |
2051 .format(author, cdate, ctime)) |
2051 .format(author, cdate, ctime)) |
2052 |
2052 |
2053 dlg = VcsRepositoryInfoDialog(None, "\n".join(info)) |
2053 dlg = VcsRepositoryInfoDialog(None, "\n".join(info)) |
2054 dlg.exec_() |
2054 dlg.exec_() |
2055 |
2055 |
2920 from .HgGraftDialog import HgGraftDialog |
2920 from .HgGraftDialog import HgGraftDialog |
2921 res = False |
2921 res = False |
2922 dlg = HgGraftDialog(self, revs) |
2922 dlg = HgGraftDialog(self, revs) |
2923 if dlg.exec_() == QDialog.Accepted: |
2923 if dlg.exec_() == QDialog.Accepted: |
2924 revs, (userData, currentUser, userName), \ |
2924 revs, (userData, currentUser, userName), \ |
2925 (dateData, currentDate, dateStr), log, dryrun = dlg.getData() |
2925 (dateData, currentDate, dateStr), log, dryrun = dlg.getData() |
2926 |
2926 |
2927 args = [] |
2927 args = [] |
2928 args.append("graft") |
2928 args.append("graft") |
2929 args.append("--verbose") |
2929 args.append("--verbose") |
2930 if userData: |
2930 if userData: |
3065 self.__ui, |
3065 self.__ui, |
3066 self.trUtf8("Add Sub-repository"), |
3066 self.trUtf8("Add Sub-repository"), |
3067 self.trUtf8( |
3067 self.trUtf8( |
3068 """<p>The sub-repositories file .hgsub could not""" |
3068 """<p>The sub-repositories file .hgsub could not""" |
3069 """ be read.</p><p>Reason: {0}</p>""") |
3069 """ be read.</p><p>Reason: {0}</p>""") |
3070 .format(str(err))) |
3070 .format(str(err))) |
3071 return |
3071 return |
3072 |
3072 |
3073 if entry in contents: |
3073 if entry in contents: |
3074 E5MessageBox.critical( |
3074 E5MessageBox.critical( |
3075 self.__ui, |
3075 self.__ui, |
3126 E5MessageBox.critical( |
3126 E5MessageBox.critical( |
3127 self.__ui, |
3127 self.__ui, |
3128 self.trUtf8("Remove Sub-repositories"), |
3128 self.trUtf8("Remove Sub-repositories"), |
3129 self.trUtf8("""<p>The sub-repositories file .hgsub could not""" |
3129 self.trUtf8("""<p>The sub-repositories file .hgsub could not""" |
3130 """ be read.</p><p>Reason: {0}</p>""") |
3130 """ be read.</p><p>Reason: {0}</p>""") |
3131 .format(str(err))) |
3131 .format(str(err))) |
3132 return |
3132 return |
3133 |
3133 |
3134 from .HgRemoveSubrepositoriesDialog import \ |
3134 from .HgRemoveSubrepositoriesDialog import \ |
3135 HgRemoveSubrepositoriesDialog |
3135 HgRemoveSubrepositoriesDialog |
3136 dlg = HgRemoveSubrepositoriesDialog(subrepositories) |
3136 dlg = HgRemoveSubrepositoriesDialog(subrepositories) |
3146 self.__ui, |
3146 self.__ui, |
3147 self.trUtf8("Remove Sub-repositories"), |
3147 self.trUtf8("Remove Sub-repositories"), |
3148 self.trUtf8( |
3148 self.trUtf8( |
3149 """<p>The sub-repositories file .hgsub could not""" |
3149 """<p>The sub-repositories file .hgsub could not""" |
3150 """ be written to.</p><p>Reason: {0}</p>""") |
3150 """ be written to.</p><p>Reason: {0}</p>""") |
3151 .format(str(err))) |
3151 .format(str(err))) |
3152 return |
3152 return |
3153 |
3153 |
3154 if deleteSubrepos: |
3154 if deleteSubrepos: |
3155 ppath = self.__projectHelper.getProject().getProjectPath() |
3155 ppath = self.__projectHelper.getProject().getProjectPath() |
3156 for removedSubrepo in removedSubrepos: |
3156 for removedSubrepo in removedSubrepos: |