Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 347
0b1a7a38f8e9
parent 305
5cf9e308f342
child 417
459855d3066e
equal deleted inserted replaced
344:3a1d9835e46b 347:0b1a7a38f8e9
1055 if procStarted: 1055 if procStarted:
1056 finished = process.waitForFinished(30000) 1056 finished = process.waitForFinished(30000)
1057 if finished and process.exitCode() == 0: 1057 if finished and process.exitCode() == 0:
1058 output = str(process.readAllStandardOutput(), 1058 output = str(process.readAllStandardOutput(),
1059 Preferences.getSystem("IOEncoding"), 'replace') 1059 Preferences.getSystem("IOEncoding"), 'replace')
1060 url = output.splitlines()[0].strip() 1060 if output:
1061 url = output.splitlines()[0].strip()
1062 else:
1063 url = ""
1061 1064
1062 return QApplication.translate('mercurial', 1065 return QApplication.translate('mercurial',
1063 """<h3>Repository information</h3>\n""" 1066 """<h3>Repository information</h3>\n"""
1064 """<p><table>\n""" 1067 """<p><table>\n"""
1065 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" 1068 """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n"""
1520 repodir = os.path.dirname(repodir) 1523 repodir = os.path.dirname(repodir)
1521 if repodir == os.sep: 1524 if repodir == os.sep:
1522 return 1525 return
1523 1526
1524 cfgFile = os.path.join(repodir, self.adminDir, "hgrc") 1527 cfgFile = os.path.join(repodir, self.adminDir, "hgrc")
1528 if not os.path.exists(cfgFile):
1529 try:
1530 cfg = open(cfgFile, "w")
1531 cfg.close()
1532 except IOError:
1533 pass
1525 self.editor = MiniEditor(cfgFile, "Properties") 1534 self.editor = MiniEditor(cfgFile, "Properties")
1526 self.editor.show() 1535 self.editor.show()
1527 1536
1528 def hgVerify(self, name): 1537 def hgVerify(self, name):
1529 """ 1538 """

eric ide

mercurial