Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py

branch
Py2 comp.
changeset 2847
1843ef6e2656
parent 2525
8b507a9a2d40
parent 2841
1f79e88f18b7
child 3057
10516539f238
--- a/Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py	Mon Aug 12 19:41:53 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/ProjectBrowserHelper.py	Mon Aug 12 22:21:53 2013 +0200
@@ -231,10 +231,17 @@
         act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
             self.trUtf8('Show difference'), self._VCSDiff)
         self.vcsMenuActions.append(act)
+        act = menu.addAction(UI.PixmapCache.getIcon("vcsSbsDiff.png"),
+            self.trUtf8('Show difference side-by-side'), self.__HgSbsDiff)
+        self.vcsMenuActions.append(act)
         act = menu.addAction(UI.PixmapCache.getIcon("vcsDiff.png"),
             self.trUtf8('Show difference (extended)'),
             self.__HgExtendedDiff)
         self.vcsMenuActions.append(act)
+        act = menu.addAction(UI.PixmapCache.getIcon("vcsSbsDiff.png"),
+            self.trUtf8('Show difference side-by-side (extended)'),
+            self.__HgSbsExtendedDiff)
+        self.vcsMenuActions.append(act)
         self.annotateAct = menu.addAction(self.trUtf8('Show annotated file'),
             self.__HgAnnotate)
         self.vcsMenuActions.append(self.annotateAct)
@@ -569,6 +576,24 @@
                 names.append(itm.dirName())
         self.vcs.hgExtendedDiff(names)
     
+    def __HgSbsDiff(self):
+        """
+        Private slot called by the context menu to show the difference of a file to
+        the repository side-by-side.
+        """
+        itm = self.browser.currentItem()
+        fn = itm.fileName()
+        self.vcs.hgSbsDiff(fn)
+    
+    def __HgSbsExtendedDiff(self):
+        """
+        Private slot called by the context menu to show the difference of a file to
+        the repository side-by-side allowing the selection of revisions to compare.
+        """
+        itm = self.browser.currentItem()
+        fn = itm.fileName()
+        self.vcs.hgSbsDiff(fn, extended=True)
+    
     def __HgAnnotate(self):
         """
         Private slot called by the context menu to show the annotations of a file.
@@ -584,9 +609,11 @@
         itm = self.browser.currentItem()
         try:
             fn = itm.fileName()
+            isFile = True
         except AttributeError:
             fn = itm.dirName()
-        self.vcs.hgLogBrowser(fn)
+            isFile = False
+        self.vcs.hgLogBrowser(fn, isFile=isFile)
     
     def __HgResolve(self):
         """

eric ide

mercurial