Commits

Angel Ezquerra  committed f6f4546

export: set the default patch name to the rev number when exporting a single revision

  • Participants
  • Parent commits 3110c9e
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/repowidget.py

         if not revisions:
             revisions = [self.rev]
         if len(revisions) == 1:
+            if isinstance(self.rev, int):
+                defaultpath = self.repo.wjoin('%d.patch' % self.rev)
+            else:
+                defaultpath = self.repo.root
+
             ret = QFileDialog.getSaveFileName(self, _('Export patch'),
-                                              hglib.tounicode(self.repo.root),
+                                              hglib.tounicode(defaultpath),
                                               _('Patch Files (*.patch)'))
             if not ret:
                 return
             epath = os.path.join(strdir,
                                  hglib.fromunicode(self.repo.shortname)+'_%r.patch')
             custompath = False
-            
+
         cmdline = ['export', '--repository', self.repo.root, '--verbose',
                    '--output', epath]