955 project = e5App().getObject("Project") |
955 project = e5App().getObject("Project") |
956 names = [project.getRelativePath(nam) for nam in names] |
956 names = [project.getRelativePath(nam) for nam in names] |
957 if names[0]: |
957 if names[0]: |
958 from UI.DeleteFilesConfirmationDialog import \ |
958 from UI.DeleteFilesConfirmationDialog import \ |
959 DeleteFilesConfirmationDialog |
959 DeleteFilesConfirmationDialog |
960 dlg = DeleteFilesConfirmationDialog(self.parent(), |
960 dlg = DeleteFilesConfirmationDialog( |
|
961 self.parent(), |
961 self.trUtf8("Revert changes"), |
962 self.trUtf8("Revert changes"), |
962 self.trUtf8( |
963 self.trUtf8( |
963 "Do you really want to revert all changes to these files" |
964 "Do you really want to revert all changes to these files" |
964 " or directories?"), |
965 " or directories?"), |
965 names) |
966 names) |
1173 process.start('hg', args) |
1174 process.start('hg', args) |
1174 procStarted = process.waitForStarted(5000) |
1175 procStarted = process.waitForStarted(5000) |
1175 if procStarted: |
1176 if procStarted: |
1176 finished = process.waitForFinished(30000) |
1177 finished = process.waitForFinished(30000) |
1177 if finished and process.exitCode() == 0: |
1178 if finished and process.exitCode() == 0: |
1178 output = \ |
1179 output = str( |
1179 str(process.readAllStandardOutput(), |
1180 process.readAllStandardOutput(), |
1180 Preferences.getSystem("IOEncoding"), |
1181 Preferences.getSystem("IOEncoding"), |
1181 'replace') |
1182 'replace') |
1182 else: |
1183 else: |
1183 output, error = self.__client.runcommand(args) |
1184 output, error = self.__client.runcommand(args) |
1184 |
1185 |
1335 process.start('hg', args) |
1336 process.start('hg', args) |
1336 procStarted = process.waitForStarted(5000) |
1337 procStarted = process.waitForStarted(5000) |
1337 if procStarted: |
1338 if procStarted: |
1338 finished = process.waitForFinished(30000) |
1339 finished = process.waitForFinished(30000) |
1339 if finished and process.exitCode() == 0: |
1340 if finished and process.exitCode() == 0: |
1340 output = str(process.readAllStandardOutput(), |
1341 output = str( |
|
1342 process.readAllStandardOutput(), |
1341 Preferences.getSystem("IOEncoding"), 'replace') |
1343 Preferences.getSystem("IOEncoding"), 'replace') |
1342 else: |
1344 else: |
1343 output, error = self.__client.runcommand(args) |
1345 output, error = self.__client.runcommand(args) |
1344 |
1346 |
1345 infoBlock = [] |
1347 infoBlock = [] |
1349 index += 1 |
1351 index += 1 |
1350 changeset, tags, author, date, branches, bookmarks = \ |
1352 changeset, tags, author, date, branches, bookmarks = \ |
1351 line.split("@@@") |
1353 line.split("@@@") |
1352 cdate, ctime = date.split()[:2] |
1354 cdate, ctime = date.split()[:2] |
1353 info = [] |
1355 info = [] |
1354 info.append(QApplication.translate("mercurial", |
1356 info.append(QApplication.translate( |
|
1357 "mercurial", |
1355 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
1358 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
1356 """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""")\ |
1359 """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""")\ |
1357 .format(index, changeset)) |
1360 .format(index, changeset)) |
1358 if tags: |
1361 if tags: |
1359 info.append(QApplication.translate("mercurial", |
1362 info.append(QApplication.translate( |
|
1363 "mercurial", |
1360 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
1364 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
1361 .format('<br/>'.join(tags.split()))) |
1365 .format('<br/>'.join(tags.split()))) |
1362 if bookmarks: |
1366 if bookmarks: |
1363 info.append(QApplication.translate("mercurial", |
1367 info.append(QApplication.translate( |
|
1368 "mercurial", |
1364 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
1369 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
1365 .format('<br/>'.join(bookmarks.split()))) |
1370 .format('<br/>'.join(bookmarks.split()))) |
1366 if branches: |
1371 if branches: |
1367 info.append(QApplication.translate("mercurial", |
1372 info.append(QApplication.translate( |
|
1373 "mercurial", |
1368 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
1374 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
1369 .format('<br/>'.join(branches.split()))) |
1375 .format('<br/>'.join(branches.split()))) |
1370 info.append(QApplication.translate("mercurial", |
1376 info.append(QApplication.translate( |
|
1377 "mercurial", |
1371 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
1378 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
1372 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
1379 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
1373 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")\ |
1380 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")\ |
1374 .format(author, cdate, ctime)) |
1381 .format(author, cdate, ctime)) |
1375 infoBlock.append("\n".join(info)) |
1382 infoBlock.append("\n".join(info)) |
1389 process.start('hg', args) |
1396 process.start('hg', args) |
1390 procStarted = process.waitForStarted(5000) |
1397 procStarted = process.waitForStarted(5000) |
1391 if procStarted: |
1398 if procStarted: |
1392 finished = process.waitForFinished(30000) |
1399 finished = process.waitForFinished(30000) |
1393 if finished and process.exitCode() == 0: |
1400 if finished and process.exitCode() == 0: |
1394 output = str(process.readAllStandardOutput(), |
1401 output = str( |
|
1402 process.readAllStandardOutput(), |
1395 Preferences.getSystem("IOEncoding"), 'replace') |
1403 Preferences.getSystem("IOEncoding"), 'replace') |
1396 else: |
1404 else: |
1397 output, error = self.__client.runcommand(args) |
1405 output, error = self.__client.runcommand(args) |
1398 |
1406 |
1399 if output: |
1407 if output: |
1400 url = output.splitlines()[0].strip() |
1408 url = output.splitlines()[0].strip() |
1401 else: |
1409 else: |
1402 url = "" |
1410 url = "" |
1403 |
1411 |
1404 return QApplication.translate('mercurial', |
1412 return QApplication.translate( |
|
1413 'mercurial', |
1405 """<h3>Repository information</h3>\n""" |
1414 """<h3>Repository information</h3>\n""" |
1406 """<p><table>\n""" |
1415 """<p><table>\n""" |
1407 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" |
1416 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" |
1408 """<tr></tr>\n""" |
1417 """<tr></tr>\n""" |
1409 """<tr><td><b>URL</b></td><td>{1}</td></tr>\n""" |
1418 """<tr><td><b>URL</b></td><td>{1}</td></tr>\n""" |
1715 procStarted = process.waitForStarted(5000) |
1724 procStarted = process.waitForStarted(5000) |
1716 if procStarted: |
1725 if procStarted: |
1717 finished = process.waitForFinished(30000) |
1726 finished = process.waitForFinished(30000) |
1718 if finished: |
1727 if finished: |
1719 if process.exitCode() == 0: |
1728 if process.exitCode() == 0: |
1720 output = str(process.readAllStandardOutput(), |
1729 output = str( |
|
1730 process.readAllStandardOutput(), |
1721 Preferences.getSystem("IOEncoding"), 'replace') |
1731 Preferences.getSystem("IOEncoding"), 'replace') |
1722 else: |
1732 else: |
1723 error = str(process.readAllStandardError(), |
1733 error = str( |
|
1734 process.readAllStandardError(), |
1724 Preferences.getSystem("IOEncoding"), 'replace') |
1735 Preferences.getSystem("IOEncoding"), 'replace') |
1725 else: |
1736 else: |
1726 error = self.trUtf8( |
1737 error = self.trUtf8( |
1727 "The hg process did not finish within 30s.") |
1738 "The hg process did not finish within 30s.") |
1728 else: |
1739 else: |
1729 error = self.trUtf8('The process {0} could not be started. ' |
1740 error = self.trUtf8( |
|
1741 'The process {0} could not be started. ' |
1730 'Ensure, that it is in the search path.').format('hg') |
1742 'Ensure, that it is in the search path.').format('hg') |
1731 else: |
1743 else: |
1732 output, error = self.__client.runcommand(args) |
1744 output, error = self.__client.runcommand(args) |
1733 |
1745 |
1734 return output, error |
1746 return output, error |
1970 process.start('hg', args) |
1982 process.start('hg', args) |
1971 procStarted = process.waitForStarted(5000) |
1983 procStarted = process.waitForStarted(5000) |
1972 if procStarted: |
1984 if procStarted: |
1973 finished = process.waitForFinished(30000) |
1985 finished = process.waitForFinished(30000) |
1974 if finished and process.exitCode() == 0: |
1986 if finished and process.exitCode() == 0: |
1975 output = str(process.readAllStandardOutput(), |
1987 output = str( |
|
1988 process.readAllStandardOutput(), |
1976 Preferences.getSystem("IOEncoding"), 'replace') |
1989 Preferences.getSystem("IOEncoding"), 'replace') |
1977 else: |
1990 else: |
1978 output, error = self.__client.runcommand(args) |
1991 output, error = self.__client.runcommand(args) |
1979 |
1992 |
1980 if output: |
1993 if output: |
1984 changeset, tags, author, date, branches, parents, bookmarks = \ |
1997 changeset, tags, author, date, branches, parents, bookmarks = \ |
1985 line.split("@@@") |
1998 line.split("@@@") |
1986 cdate, ctime = date.split()[:2] |
1999 cdate, ctime = date.split()[:2] |
1987 info.append("""<p><table>""") |
2000 info.append("""<p><table>""") |
1988 if mode == "heads": |
2001 if mode == "heads": |
1989 info.append(QApplication.translate("mercurial", |
2002 info.append(QApplication.translate( |
|
2003 "mercurial", |
1990 """<tr><td><b>Head #{0}</b></td><td></td></tr>\n""" |
2004 """<tr><td><b>Head #{0}</b></td><td></td></tr>\n""" |
1991 .format(index, changeset))) |
2005 .format(index, changeset))) |
1992 elif mode == "parents": |
2006 elif mode == "parents": |
1993 info.append(QApplication.translate("mercurial", |
2007 info.append(QApplication.translate( |
|
2008 "mercurial", |
1994 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
2009 """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" |
1995 .format(index, changeset))) |
2010 .format(index, changeset))) |
1996 elif mode == "tip": |
2011 elif mode == "tip": |
1997 info.append(QApplication.translate("mercurial", |
2012 info.append(QApplication.translate( |
|
2013 "mercurial", |
1998 """<tr><td><b>Tip</b></td><td></td></tr>\n""")) |
2014 """<tr><td><b>Tip</b></td><td></td></tr>\n""")) |
1999 info.append(QApplication.translate("mercurial", |
2015 info.append(QApplication.translate( |
|
2016 "mercurial", |
2000 """<tr><td><b>Changeset</b></td><td>{0}</td></tr>""")\ |
2017 """<tr><td><b>Changeset</b></td><td>{0}</td></tr>""")\ |
2001 .format(changeset)) |
2018 .format(changeset)) |
2002 if tags: |
2019 if tags: |
2003 info.append(QApplication.translate("mercurial", |
2020 info.append(QApplication.translate( |
|
2021 "mercurial", |
2004 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
2022 """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ |
2005 .format('<br/>'.join(tags.split()))) |
2023 .format('<br/>'.join(tags.split()))) |
2006 if bookmarks: |
2024 if bookmarks: |
2007 info.append(QApplication.translate("mercurial", |
2025 info.append(QApplication.translate( |
|
2026 "mercurial", |
2008 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
2027 """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ |
2009 .format('<br/>'.join(bookmarks.split()))) |
2028 .format('<br/>'.join(bookmarks.split()))) |
2010 if branches: |
2029 if branches: |
2011 info.append(QApplication.translate("mercurial", |
2030 info.append(QApplication.translate( |
|
2031 "mercurial", |
2012 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
2032 """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ |
2013 .format('<br/>'.join(branches.split()))) |
2033 .format('<br/>'.join(branches.split()))) |
2014 if parents: |
2034 if parents: |
2015 info.append(QApplication.translate("mercurial", |
2035 info.append(QApplication.translate( |
|
2036 "mercurial", |
2016 """<tr><td><b>Parents</b></td><td>{0}</td></tr>""")\ |
2037 """<tr><td><b>Parents</b></td><td>{0}</td></tr>""")\ |
2017 .format('<br/>'.join(parents.split()))) |
2038 .format('<br/>'.join(parents.split()))) |
2018 info.append(QApplication.translate("mercurial", |
2039 info.append(QApplication.translate( |
|
2040 "mercurial", |
2019 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
2041 """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" |
2020 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
2042 """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" |
2021 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>\n""" |
2043 """<tr><td><b>Committed time</b></td><td>{2}</td></tr>\n""" |
2022 """</table></p>""")\ |
2044 """</table></p>""")\ |
2023 .format(author, cdate, ctime)) |
2045 .format(author, cdate, ctime)) |
3190 process.start('hg', args) |
3212 process.start('hg', args) |
3191 procStarted = process.waitForStarted(5000) |
3213 procStarted = process.waitForStarted(5000) |
3192 if procStarted: |
3214 if procStarted: |
3193 finished = process.waitForFinished(30000) |
3215 finished = process.waitForFinished(30000) |
3194 if finished and process.exitCode() == 0: |
3216 if finished and process.exitCode() == 0: |
3195 output = str(process.readAllStandardOutput(), |
3217 output = str( |
|
3218 process.readAllStandardOutput(), |
3196 Preferences.getSystem("IOEncoding"), 'replace') |
3219 Preferences.getSystem("IOEncoding"), 'replace') |
3197 else: |
3220 else: |
3198 output, error = self.__client.runcommand(args) |
3221 output, error = self.__client.runcommand(args) |
3199 |
3222 |
3200 if output: |
3223 if output: |