Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 347
0b1a7a38f8e9
parent 305
5cf9e308f342
child 417
459855d3066e
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Jun 12 18:12:41 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jun 13 15:45:06 2010 +0200
@@ -1057,7 +1057,10 @@
             if finished and process.exitCode() == 0:
                 output = str(process.readAllStandardOutput(), 
                     Preferences.getSystem("IOEncoding"), 'replace')
-                url = output.splitlines()[0].strip()
+                if output:
+                    url = output.splitlines()[0].strip()
+                else:
+                    url = ""
         
         return QApplication.translate('mercurial',
             """<h3>Repository information</h3>\n"""
@@ -1522,6 +1525,12 @@
                 return
         
         cfgFile = os.path.join(repodir, self.adminDir, "hgrc")
+        if not os.path.exists(cfgFile):
+            try:
+                cfg = open(cfgFile, "w")
+                cfg.close()
+            except IOError:
+                pass
         self.editor = MiniEditor(cfgFile, "Properties")
         self.editor.show()
     

eric ide

mercurial