Commits

Yuya Nishihara  committed 07bd2f5

import: use userData of targetcombo to build command-line parameter

See also 65c71e175800.

  • Participants
  • Parent commits 536fbc0

Comments (0)

Files changed (1)

File tortoisehg/hgqt/thgimport.py

     def thgimport(self):
         if self.cslist.curitems is None:
             return
-        idx = self.targetcombo.currentIndex()
-        if idx == 1:
+        cmdline = list(self._targetcommand())
+        if cmdline == ['copy']:
             # import to shelf
             existing = self.repo.thgshelves()
             if not os.path.exists(self.repo.shelfdir):
             for file in self.cslist.curitems:
                 shutil.copy(file, self.repo.shelfdir)
             return
-        hgcmd = ('import', 'copy', 'import --no-commit', 'qimport')[idx]
-        cmdline = hgcmd.split(' ') + ['--repository', self.repo.root]
+        cmdline.extend(['--repository', self.repo.root])
         if self.p0chk.isChecked():
             cmdline.append('-p0')
         cmdline.extend(['--verbose', '--'])