Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 2576
b984efd69f15
parent 2543
eb9472947653
child 2597
951e631c9c1d
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Apr 13 13:10:43 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Sat Apr 13 14:58:04 2013 +0200
@@ -101,6 +101,7 @@
         self.serveDlg = None
         
         self.bundleFile = None
+        self.__lastChangeGroupPath = None
         
         self.statusCache = {}
         
@@ -2141,7 +2142,7 @@
             fname, selectedFilter = E5FileDialog.getSaveFileNameAndFilter(
                 None,
                 self.trUtf8("Create changegroup"),
-                repodir,
+                self.__lastChangeGroupPath or repodir,
                 self.trUtf8("Mercurial Changegroup Files (*.hg)"),
                 None,
                 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite))
@@ -2164,6 +2165,7 @@
                 if not res:
                     return
             fname = Utilities.toNativeSeparators(fname)
+            self.__lastChangeGroupPath = os.path.dirname(fname)
             
             args = []
             args.append('bundle')
@@ -2204,9 +2206,11 @@
         file = E5FileDialog.getOpenFileName(
             None,
             self.trUtf8("Preview changegroup"),
-            repodir,
+            self.__lastChangeGroupPath or repodir,
             self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)"))
         if file:
+            self.__lastChangeGroupPath = os.path.dirname(self.__lastChangeGroupPath)
+            
             if self.getPlugin().getPreferences("UseLogBrowser"):
                 from .HgLogBrowserDialog import HgLogBrowserDialog
                 self.logBrowser = \
@@ -2237,9 +2241,11 @@
         file = E5FileDialog.getOpenFileName(
             None,
             self.trUtf8("Preview changegroup"),
-            repodir,
+            self.__lastChangeGroupPath or repodir,
             self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)"))
         if file:
+            self.__lastChangeGroupPath = os.path.dirname(self.__lastChangeGroupPath)
+            
             args = []
             args.append('identify')
             args.append(file)
@@ -2270,9 +2276,11 @@
         files = E5FileDialog.getOpenFileNames(
             None,
             self.trUtf8("Apply changegroups"),
-            repodir,
+            self.__lastChangeGroupPath or repodir,
             self.trUtf8("Mercurial Changegroup Files (*.hg);;All Files (*)"))
         if files:
+            self.__lastChangeGroupPath = os.path.dirname(files[0])
+            
             update = E5MessageBox.yesNo(self.__ui,
                 self.trUtf8("Apply changegroups"),
                 self.trUtf8("""Shall the working directory be updated?"""),

eric ide

mercurial