Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py

changeset 2581
a3498dcc75cc
parent 2405
d4b5f3bd4720
child 2677
3d4277929fb3
child 2771
281c9b30dd91
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Apr 14 12:25:38 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Apr 14 13:12:53 2013 +0200
@@ -199,50 +199,52 @@
         errMsg = ""
         parents = []
         
-        args = []
-        args.append("parents")
-        if self.mode == "incoming":
-            if self.bundle:
-                args.append("--repository")
-                args.append(self.bundle)
-            elif self.vcs.bundleFile and os.path.exists(self.vcs.bundleFile):
-                args.append("--repository")
-                args.append(self.vcs.bundleFile)
-        args.append("--template")
-        args.append("{rev}:{node|short}\n")
-        args.append("-r")
-        args.append(rev)
-        if not self.projectMode:
-            args.append(self.filename)
-        
-        output = ""
-        if self.__hgClient:
-            output, errMsg = self.__hgClient.runcommand(args)
-        else:
-            process = QProcess()
-            process.setWorkingDirectory(self.repodir)
-            process.start('hg', args)
-            procStarted = process.waitForStarted()
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    output = \
-                        str(process.readAllStandardOutput(),
-                            Preferences.getSystem("IOEncoding"),
-                            'replace')
+        if int(rev) > 0:
+            args = []
+            args.append("parents")
+            if self.mode == "incoming":
+                if self.bundle:
+                    args.append("--repository")
+                    args.append(self.bundle)
+                elif self.vcs.bundleFile and os.path.exists(self.vcs.bundleFile):
+                    args.append("--repository")
+                    args.append(self.vcs.bundleFile)
+            args.append("--template")
+            args.append("{rev}:{node|short}\n")
+            args.append("-r")
+            args.append(rev)
+            if not self.projectMode:
+                args.append(self.filename)
+            
+            output = ""
+            if self.__hgClient:
+                output, errMsg = self.__hgClient.runcommand(args)
+            else:
+                process = QProcess()
+                process.setWorkingDirectory(self.repodir)
+                process.start('hg', args)
+                procStarted = process.waitForStarted()
+                if procStarted:
+                    finished = process.waitForFinished(30000)
+                    if finished and process.exitCode() == 0:
+                        output = \
+                            str(process.readAllStandardOutput(),
+                                Preferences.getSystem("IOEncoding"),
+                                'replace')
+                    else:
+                        if not finished:
+                            errMsg = self.trUtf8(
+                                "The hg process did not finish within 30s.")
                 else:
-                    if not finished:
-                        errMsg = self.trUtf8("The hg process did not finish within 30s.")
-            else:
-                errMsg = self.trUtf8("Could not start the hg executable.")
-        
-        if errMsg:
-            E5MessageBox.critical(self,
-                self.trUtf8("Mercurial Error"),
-                errMsg)
-        
-        if output:
-            parents = [p for p in output.strip().splitlines()]
+                    errMsg = self.trUtf8("Could not start the hg executable.")
+            
+            if errMsg:
+                E5MessageBox.critical(self,
+                    self.trUtf8("Mercurial Error"),
+                    errMsg)
+            
+            if output:
+                parents = [p for p in output.strip().splitlines()]
         
         return parents
     

eric ide

mercurial