Commits

Yuya Nishihara committed 10622ca

rename: merge runCommand with deprecated internal method

  • Participants
  • Parent commits d4ceac4

Comments (0)

Files changed (1)

File tortoisehg/hgqt/rename.py

                     and not (self.isCopyCommand()
                              and self.isCaseFoldingOnWin()))
 
-    def rename(self):
+    def runCommand(self):
         # check inputs
         src = self.get_src()
         dest = self.get_dest()
         if not os.path.exists(src):
             qtlib.WarningMsgBox(self.msgTitle, _('Source does not exists.'))
-            return
+            return cmdcore.nullCmdSession()
         fullsrc = os.path.abspath(src)
         if not fullsrc.startswith(self.repo.root):
             qtlib.ErrorMsgBox(self.errTitle,
                     _('The source must be within the repository tree.'))
-            return
+            return cmdcore.nullCmdSession()
         fulldest = os.path.abspath(dest)
         if not fulldest.startswith(self.repo.root):
             qtlib.ErrorMsgBox(self.errTitle,
                     _('The destination must be within the repository tree.'))
-            return
+            return cmdcore.nullCmdSession()
         if (os.path.isfile(dest) and not self.isCaseFoldingOnWin()):
             res = qtlib.QuestionMsgBox(self.msgTitle, '<p>%s</p><p>%s</p>' %
                     (_('Destination file already exists.'),
                     _('Are you sure you want to overwrite it ?')),
                     defaultbutton=QMessageBox.No)
             if not res:
-                return
+                return cmdcore.nullCmdSession()
 
         cmdline = self.compose_command(src, dest)
         self.show_command(cmdline)
-        return cmdline
-
-    def runCommand(self):
-        cmdline = self.rename()
-        if not cmdline:
-            return cmdcore.nullCmdSession()
         cmdline = map(hglib.tounicode, cmdline)
         return self._repoagent.runCommand(cmdline, self)