eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py

changeset 7971
ff2971513d6d
parent 7923
91e843545d9a
child 8143
2c730d5fd177
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Tue Jan 12 20:03:30 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Wed Jan 13 17:46:13 2021 +0100
@@ -7,8 +7,6 @@
 Module implementing Mercurial shelve browser dialog.
 """
 
-import os
-
 from PyQt5.QtCore import pyqtSlot, Qt, QPoint
 from PyQt5.QtWidgets import (
     QWidget, QDialogButtonBox, QTreeWidgetItem, QAbstractButton, QMenu,
@@ -146,24 +144,13 @@
             self.__processBuffer()
         self.__finish()
     
-    def start(self, projectDir):
+    def start(self):
         """
         Public slot to start the hg shelve command.
-        
-        @param projectDir name of the project directory (string)
         """
         self.errorGroup.hide()
         QApplication.processEvents()
         
-        self.__projectDir = projectDir
-        
-        # find the root of the repo
-        self.repodir = self.__projectDir
-        while not os.path.isdir(os.path.join(self.repodir, self.vcs.adminDir)):
-            self.repodir = os.path.dirname(self.repodir)
-            if os.path.splitdrive(self.repodir)[1] == os.sep:
-                return
-        
         self.activateWindow()
         self.raise_()
         
@@ -311,7 +298,7 @@
         
         self.refreshButton.setEnabled(False)
         
-        self.start(self.__projectDir)
+        self.start()
     
     def __unshelve(self):
         """
@@ -320,8 +307,7 @@
         itm = self.shelveList.selectedItems()[0]
         if itm is not None:
             name = itm.text(self.NameColumn)
-            self.vcs.getExtensionObject("shelve").hgUnshelve(
-                self.__projectDir, shelveName=name)
+            self.vcs.getExtensionObject("shelve").hgUnshelve(shelveName=name)
             self.on_refreshButton_clicked()
     
     def __deleteShelves(self):
@@ -333,13 +319,12 @@
             shelveNames.append(itm.text(self.NameColumn))
         if shelveNames:
             self.vcs.getExtensionObject("shelve").hgDeleteShelves(
-                self.__projectDir, shelveNames=shelveNames)
+                shelveNames=shelveNames)
             self.on_refreshButton_clicked()
     
     def __cleanupShelves(self):
         """
         Private slot to delete all shelves.
         """
-        self.vcs.getExtensionObject("shelve").hgCleanupShelves(
-            self.__projectDir)
+        self.vcs.getExtensionObject("shelve").hgCleanupShelves()
         self.on_refreshButton_clicked()

eric ide

mercurial