Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 2811
7b2ec3af3505
parent 2771
281c9b30dd91
child 2815
53c1d1f9ec86
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Jul 20 16:01:55 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Jul 21 18:14:10 2013 +0200
@@ -94,6 +94,7 @@
         self.logBrowser = None
         self.diff = None
         self.status = None
+        self.summary = None
         self.tagbranchList = None
         self.annotate = None
         self.repoEditor = None
@@ -159,6 +160,8 @@
             self.diff.close()
         if self.status is not None:
             self.status.close()
+        if self.summary is not None:
+            self.summary.close()
         if self.tagbranchList is not None:
             self.tagbranchList.close()
         if self.annotate is not None:
@@ -821,6 +824,18 @@
         self.status.show()
         self.status.start(name)
     
+    def hgSummary(self, mq=False):
+        """
+        Public method used to show some summary information of the
+        working directory state.
+        
+        @param mq flag indicating to show the queue status as well (boolean)
+        """
+        from .HgSummaryDialog import HgSummaryDialog
+        self.summary = HgSummaryDialog(self)
+        self.summary.show()
+        self.summary.start(self.__projectHelper.getProject().getProjectPath(), mq=mq)
+    
     def vcsTag(self, name):
         """
         Public method used to set the tag in the Mercurial repository.
@@ -1250,8 +1265,6 @@
         @param ppath local path to get the repository infos (string)
         @return string with ready formated info for display (string)
         """
-        info = []
-        
         args = []
         args.append('parents')
         args.append('--template')
@@ -1272,13 +1285,14 @@
         else:
             output, error = self.__client.runcommand(args)
         
+        infoBlock = []
         if output:
             index = 0
             for line in output.splitlines():
                 index += 1
                 changeset, tags, author, date, branches, bookmarks = line.split("@@@")
                 cdate, ctime = date.split()[:2]
-                info.append("""<p><table>""")
+                info = []
                 info.append(QApplication.translate("mercurial",
                     """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n"""
                     """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""")\
@@ -1300,7 +1314,11 @@
                     """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n"""
                     """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")\
                     .format(author, cdate, ctime))
-                info.append("""</table></p>""")
+                infoBlock.append("\n".join(info))
+        if infoBlock:
+            infoStr = """<tr></tr>{0}""".format("<tr></tr>".join(infoBlock))
+        else:
+            infoStr = ""
         
         url = ""
         args = []
@@ -1331,9 +1349,9 @@
             """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n"""
             """<tr></tr>\n"""
             """<tr><td><b>URL</b></td><td>{1}</td></tr>\n"""
+            """{2}"""
             """</table></p>\n"""
-            """{2}"""
-            ).format(self.versionStr, url, "\n".join(info))
+            ).format(self.versionStr, url, infoStr)
 
     ############################################################################
     ## Private Mercurial specific methods are below.

eric ide

mercurial