Commits

Yuya Nishihara committed 341f764

clone: handle location of source patch repository as full path

It isn't a relative path to source repository, but to cwd:
http://selenic.com/repo/hg/file/34a1a639d835/hgext/mq.py#l2269

  • Participants
  • Parent commits 33b9308
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgqt/clone.py

         rev = hglib.fromunicode(self.rev_text.text().trimmed())
         startrev = hglib.fromunicode(self.startrev_text.text().trimmed())
         if self.qclone_chk.isChecked():
+            cmdline = ['qclone']
             qclonedir = hglib.fromunicode(self.qclone_txt.text().trimmed())
-            if qclonedir == '':
-                qclonedir = '.hg\patches'
-                self.qclone_txt.setText(qclonedir)
-            cmdline = ['qclone']
-            if not qclonedir in ['.hg\patches', '.hg/patches', '']:
+            if qclonedir:
                 cmdline += ['--patches', qclonedir]
         else:
             cmdline = ['clone']
         upath = FD.getExistingDirectory(self, caption, upatchroot,
                                         QFileDialog.ShowDirsOnly)
         if upath:
-            path = hglib.fromunicode(upath).replace('/', os.sep)
-            src = hglib.fromunicode(self.src_combo.currentText())
-            if not path.startswith(src):
-                qtlib.ErrorMsgBox('TortoiseHg QClone',
-                    _('The selected patch folder is not'
-                      ' under the source repository.'),
-                    '<p>src = %s</p><p>path = %s</p>' % (src, path))
-                return
-            path = path.replace(src + os.sep, '')
-            self.qclone_txt.setText(QDir.toNativeSeparators(hglib.tounicode(path)))
+            self.qclone_txt.setText(QDir.toNativeSeparators(upath))
             self.qclone_txt.setFocus()
         self.composeCommand()