Added some code to inspect incoming patches as well.

Tue, 27 Apr 2010 17:30:55 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 27 Apr 2010 17:30:55 +0000
changeset 207
3f889378dede
parent 206
e24ba21c6d3a
child 208
26ed553ad4fb

Added some code to inspect incoming patches as well.

Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Sun Apr 25 18:06:50 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Tue Apr 27 17:30:55 2010 +0000
@@ -106,6 +106,10 @@
         self.vcs.addArguments(args, self.vcs.options['global'])
         self.vcs.addArguments(args, self.vcs.options['diff'])
         
+        if self.vcs.bundleFile:
+            args.append('--repository')
+            args.append(self.vcs.bundleFile)
+        
         if versions is not None:
             self.raise_()
             self.activateWindow()
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Apr 25 18:06:50 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Tue Apr 27 17:30:55 2010 +0000
@@ -14,6 +14,8 @@
     QApplication, QMessageBox, QCursor, QWidget, QLineEdit, QColor, QPixmap, \
     QPainter, QPen, QBrush, QIcon
 
+from E5Gui.E5Application import e5App
+
 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
 from .HgDiffDialog import HgDiffDialog
 
@@ -445,6 +447,12 @@
             args.append('--copies')
         args.append('--style')
         args.append(os.path.join(os.path.dirname(__file__), "styles", "logBrowser.style"))
+        if self.commandMode == "incoming":
+            project = e5App().getObject("Project")
+            self.vcs.bundleFile = os.path.join(
+                project.getProjectManagementDir(), "hg-bundle.hg")
+            args.append('--bundle')
+            args.append(self.vcs.bundleFile)
         if not self.projectMode:
             args.append(self.filename)
         
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Sun Apr 25 18:06:50 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py	Tue Apr 27 17:30:55 2010 +0000
@@ -13,6 +13,8 @@
 from PyQt4.QtGui import QWidget, QDialogButtonBox, QApplication, QMessageBox, \
     QLineEdit, QTextCursor
 
+from E5Gui.E5Application import e5App
+
 from .Ui_HgLogDialog import Ui_HgLogDialog
 from .HgDiffDialog import HgDiffDialog
 
@@ -112,10 +114,18 @@
         if noEntries:
             args.append('--limit')
             args.append(str(noEntries))
+        if self.mode in ("incoming", "outgoing"):
+            args.append("--newest-first")
         if self.mode == "log":
             args.append('--copies')
         args.append('--style')
         args.append(os.path.join(os.path.dirname(__file__), "styles", "logDialog.style"))
+        if self.mode == "incoming":
+            project = e5App().getObject("Project")
+            self.vcs.bundleFile = os.path.join(
+                project.getProjectManagementDir(), "hg-bundle.hg")
+            args.append('--bundle')
+            args.append(self.vcs.bundleFile)
         if self.fname != "." or self.dname != repodir:
             args.append(self.filename)
         
@@ -172,6 +182,9 @@
                     try:
                         lv = self.revisions[lvers]
                         lvers += 1
+                    except IndexError:
+                        lv = str(int(rev) - 1)
+                    if rev != "0":
                         url = QUrl()
                         url.setScheme("file")
                         url.setPath(self.filename)
@@ -183,8 +196,6 @@
                             str(query, encoding="ascii"), 
                             self.trUtf8('diff to {0}').format(lv), 
                         )
-                    except IndexError:
-                        pass
                     dstr += '<br />\n'
                     self.contents.insertHtml(dstr)
                 elif key == "branches":
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sun Apr 25 18:06:50 2010 +0000
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Apr 27 17:30:55 2010 +0000
@@ -103,6 +103,7 @@
         self.tagbranchList = None
         self.annotate = None
         self.editor = None
+        self.bundleFile = None
         
         self.statusCache = {}
         
@@ -131,6 +132,9 @@
             self.tagbranchList.close()
         if self.annotate is not None:
             self.annotate.close()
+        
+        if self.bundleFile and os.path.exists(self.bundleFile):
+            os.remove(self.bundleFile)
     
     def vcsExists(self):
         """

eric ide

mercurial