1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Angel Ezquerra  committed 4862de1

resolve: show info about the "local" and "other" revisions (closes #458)

This adds two csinfo widgets to the top of the resolve window, containing the
information about the local and the other revisions of a merge.

Note that the resolve window can be open even if we are in the middle of a merge
between two revisions (e.g. when merging local changes during and update). In
those cases the revision information is not trivial and for now it will simply
not be displayed.

  • Participants
  • Parent commits bcede01
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/resolve.py

View file
  • Ignore whitespace
 
 from tortoisehg.util import hglib
 from tortoisehg.hgqt.i18n import _
-from tortoisehg.hgqt import qtlib, cmdui, wctxactions, visdiff, thgrepo
+from tortoisehg.hgqt import qtlib, cmdui, wctxactions, visdiff, thgrepo, csinfo
 
 MARGINS = (8, 0, 0, 0)
 
         hbox.addWidget(tb)
         hbox.addWidget(self.stlabel)
 
+        def revisionInfoLayout(repo):
+            """
+            Return a layout containg the revision information (local and other)
+            """
+            hbox = QHBoxLayout()
+            hbox.setSpacing(0)
+            hbox.setContentsMargins(*MARGINS)
+
+            vbox = QVBoxLayout()
+            vbox.setContentsMargins(*MARGINS)
+            hbox.addLayout(vbox)
+            localrevtitle = qtlib.LabeledSeparator(_('Local revision information'))
+            localrevinfo = csinfo.create(repo)
+            localrevinfo.update(repo[None].p1())
+            vbox.addWidget(localrevtitle)
+            vbox.addWidget(localrevinfo)
+            vbox.addStretch()
+
+            vbox = QVBoxLayout()
+            vbox.setContentsMargins(*MARGINS)
+            hbox.addLayout(vbox)
+            otherrevtitle = qtlib.LabeledSeparator(_('Other revision information'))
+            otherrevinfo = csinfo.create(repo)
+            otherrevinfo.update(repo[None].p2())
+
+            vbox.addWidget(otherrevtitle)
+            vbox.addWidget(otherrevinfo)
+            vbox.addStretch()
+
+            return hbox
+
+        if len(self.repo[None].parents()) > 1:
+            self.layout().addLayout(revisionInfoLayout(self.repo))
+
         unres = qtlib.LabeledSeparator(_('Unresolved conflicts'))
         self.layout().addWidget(unres)