Commits

Anonymous committed af1eacc

cmenu: always show Merge Revisions menu

but only enable is repo is ready to be merged. Undo Merge is
only displayed when needed, i.e. when repo is merging state.

Comments (0)

Files changed (1)

tortoise/contextmenu.py

                            _("update working directory"),
                            self._update, icon="menucheckout.ico"))
 
-            # if change merge menu per merge status of working directory
-            if len(repo.workingctx().parents()) == 1:
-                result.append(TortoiseMenu(_("Merge Revisions"),
-                               _("merge working directory with another revision"),
-                               self._merge, icon="menumerge.ico"))
-            else:
+            can_merge = len(repo.heads()) > 1 and \
+                        len(repo.workingctx().parents()) < 2
+            result.append(TortoiseMenu(_("Merge Revisions"),
+                           _("merge working directory with another revision"),
+                           self._merge, icon="menumerge.ico",
+                           state=can_merge))
+
+            # show un-merge menu per merge status of working directory
+            if len(repo.workingctx().parents()) > 1:
                 result.append(TortoiseMenu(_("Undo Merge"),
                                _("Undo merge by updating to revision"),
                                self._merge, icon="menuunmerge.ico"))
-                
+
             result.append(TortoiseMenuSep())
 
             result.append(TortoiseMenu(_("View Changelog"),