eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 7971
ff2971513d6d
parent 7970
c4ee8a81584c
child 8043
0acf98cd089a
child 8143
2c730d5fd177
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -594,7 +594,7 @@
         return col, color, edges
     
     def __generateIcon(self, column, color, bottomedges, topedges, dotColor,
-                       currentRev, closed, isDraft):
+                       currentRev, closed, isPushableDraft):
         """
         Private method to generate an icon containing the revision tree for the
         given data.
@@ -615,7 +615,8 @@
         @param closed flag indicating to draw an icon for a closed
             branch
         @type bool
-        @param isDraft flag indicating an entry of phase 'draft'
+        @param isPushableDraft flag indicating an entry of phase 'draft',
+            that can by pushed
         @type bool
         @return icon for the node
         @rtype QIcon
@@ -692,8 +693,9 @@
                     QPoint(dot_x + 2 * offset, dot_y + 2 * offset)
                 )
         else:
-            if isDraft:
-                # 'draft' phase: draw an up arrow like outgoing
+            if isPushableDraft:
+                # 'draft' phase: draw an up arrow like outgoing,
+                # if it can be pushed
                 offset = radius // 2
                 painter.drawConvexPolygon(
                     QPoint(dot_x + offset, dot_y),
@@ -859,24 +861,37 @@
     
     def __generateLogItem(self, author, date, message, revision, changedPaths,
                           parents, branches, tags, phase, bookmarks,
-                          latestTag):
+                          latestTag, canPush=False):
         """
         Private method to generate a log tree entry.
         
-        @param author author info (string)
-        @param date date info (string)
-        @param message text of the log message (list of strings)
-        @param revision revision info (string)
+        @param author author info
+        @type str
+        @param date date info
+        @type str
+        @param message text of the log message
+        @type list of str
+        @param revision revision info
+        @type str
         @param changedPaths list of dictionary objects containing
             info about the changed files/directories
-        @param parents list of parent revisions (list of integers)
-        @param branches list of branches (list of strings)
-        @param tags list of tags (string)
-        @param phase phase of the entry (string)
-        @param bookmarks list of bookmarks (string)
+        @type dict
+        @param parents list of parent revisions
+        @type list of int
+        @param branches list of branches
+        @type list of str
+        @param tags list of tags
+        @type str
+        @param phase phase of the entry
+        @type str
+        @param bookmarks list of bookmarks
+        @type str
         @param latestTag the latest tag(s) reachable from the changeset
-            (list of strings)
-        @return reference to the generated item (QTreeWidgetItem)
+        @type list of str
+        @param canPush flag indicating that changesets can be pushed
+        @type bool
+        @return reference to the generated item
+        @rtype QTreeWidgetItem
         """
         logMessageColumnWidth = self.vcs.getPlugin().getPreferences(
             "LogMessageColumnWidth")
@@ -945,7 +960,7 @@
                                    QColor(self.__branchColor(branches[0])),
                                    rev in self.__projectWorkingDirParents,
                                    rev in self.__closedBranchesRevs,
-                                   phase == "draft")
+                                   phase == "draft" and canPush)
         itm.setIcon(0, icon)
         
         try:
@@ -1131,6 +1146,7 @@
         changedPaths = []
         initialText = True
         fileCopies = {}
+        canPush = self.vcs.canPush()
         for s in self.buf:
             if s != "@@@\n":
                 try:
@@ -1220,7 +1236,8 @@
                         log["author"], log["date"],
                         log["message"], log["revision"], changedPaths,
                         log["parents"], log["branches"], log["tags"],
-                        log["phase"], log["bookmarks"], log["latesttag"])
+                        log["phase"], log["bookmarks"], log["latesttag"],
+                        canPush=canPush)
                     dt = QDate.fromString(log["date"], Qt.ISODate)
                     if (
                         not self.__maxDate.isValid() and

eric ide

mercurial