Fixed an issue with the Mercurial plugin (missing .hg/hgrc file). 5_0_x

Sun, 13 Jun 2010 15:47:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 13 Jun 2010 15:47:09 +0200
branch
5_0_x
changeset 349
f6b0d8802096
parent 346
d226d7cb7a6d
child 352
a14693e59198

Fixed an issue with the Mercurial plugin (missing .hg/hgrc file).

Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
diff -r d226d7cb7a6d -r f6b0d8802096 Plugins/VcsPlugins/vcsMercurial/hg.py
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jun 13 14:38:57 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jun 13 15:47:09 2010 +0200
@@ -1053,7 +1053,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"""
@@ -1515,6 +1518,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