Made the last change a bit more robust.

Fri, 21 Feb 2014 19:01:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 21 Feb 2014 19:01:23 +0100
changeset 3292
2feabde31912
parent 3291
58e95eea9b6d
child 3293
aea7acdfc2af

Made the last change a bit more robust.

Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py	Fri Feb 21 18:57:15 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py	Fri Feb 21 19:01:23 2014 +0100
@@ -26,7 +26,8 @@
         super().__init__(parent)
         self.setupUi(self)
         
-        self.dateTimeEdit.setDateTime(QDateTime.currentDateTime())
+        self.__initialDateTime = QDateTime.currentDateTime()
+        self.dateTimeEdit.setDateTime(self.__initialDateTime)
     
     def getData(self):
         """
@@ -36,9 +37,13 @@
             message (string) and a flag indicating to add/remove
             new/missing files (boolean)
         """
+        if self.dateTimeEdit.dateTime() != self.__initialDateTime:
+            dateTime = self.dateTimeEdit.dateTime()
+        else:
+            dateTime = QDateTime()
         return (
             self.nameEdit.text(),
-            self.dateTimeEdit.dateTime(),
+            dateTime,
             self.messageEdit.toPlainText(),
             self.addRemoveCheckBox.isChecked(),
         )
--- a/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Fri Feb 21 18:57:15 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/shelve.py	Fri Feb 21 19:01:23 2014 +0100
@@ -9,7 +9,7 @@
 
 import os
 
-from PyQt4.QtCore import QDateTime
+##from PyQt4.QtCore import QDateTime
 from PyQt4.QtGui import QDialog
 
 from ..HgExtension import HgExtension
@@ -69,7 +69,7 @@
                 args.append(message)
             if addRemove:
                 args.append("--addRemove")
-            if dateTime != QDateTime.currentDateTime():
+            if dateTime.isValid():
                 args.append("--date")
                 args.append(dateTime.toString("yyyy-MM-dd hh:mm:ss"))
             args.append("-v")

eric ide

mercurial