Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

history: validate path is not empty

Also consistently use fromutf when reading text from the path entry

Fixes #627

Changeset d23cd8096b38

Parent 1de70c744614

by Steve Borho

Changes to one file · Browse files at d23cd8096b38 Showing diff from parent 1de70c744614 Diff from another changeset...

 
1045
1046
1047
 
 
 
 
 
 
 
1048
1049
1050
1051
1052
1053
1054
1055
1056
 
1123
1124
1125
1126
 
 
 
 
 
 
 
1127
1128
1129
 
1138
1139
1140
 
 
 
 
 
 
 
1141
1142
1143
1144
 
1145
1146
1147
 
1196
1197
1198
 
 
 
 
 
 
1199
1200
1201
 
1525
1526
1527
 
 
 
 
 
 
1528
1529
1530
 
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
 
1060
1061
1062
 
1129
1130
1131
 
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
 
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
 
1163
1164
1165
1166
 
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
 
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
@@ -1045,12 +1045,18 @@
  except OSError:   pass   + path = hglib.fromutf(self.pathentry.get_text()).strip() + if not path: + gdialog.Prompt(_('No remote path specified'), + _('Please enter or select a remote path'), + self).run() + self.pathentry.grab_focus() + return   if not self.bundledir:   self.bundledir = tempfile.mkdtemp(prefix='thg-incoming-')   atexit.register(cleanup)     origurl = self.urlcombo.get_active() - path = self.pathentry.get_text()   bfile = path   for badchar in (':', '*', '\\', '?', '#'):   bfile = bfile.replace(badchar, '') @@ -1123,7 +1129,13 @@
  # load the rebase extension explicitly   extensions.load(self.ui, 'rebase', None)   - path = self.pathentry.get_text() + path = hglib.fromutf(self.pathentry.get_text()).strip() + if not path: + gdialog.Prompt(_('No remote path specified'), + _('Please enter or select a remote path'), + self).run() + self.pathentry.grab_focus() + return   cmdline = ['hg'] + cmd + self.get_proxy_args() + [path]   dlg = hgcmd.CmdDialog(cmdline, text=' '.join(['hg'] + cmd))   dlg.show_all() @@ -1138,10 +1150,17 @@
  self.reload_log()     def outgoing_clicked(self, toolbutton): + path = hglib.fromutf(self.pathentry.get_text()).strip() + if not path: + gdialog.Prompt(_('No remote path specified'), + _('Please enter or select a remote path'), + self).run() + self.pathentry.grab_focus() + return   q = Queue.Queue()   cmd = [q, 'outgoing', '--quiet', '--template', '{node}\n']   cmd += self.get_proxy_args() - cmd += [self.pathentry.get_text()] + cmd += [path]     def threadfunc(q, *args):   try: @@ -1196,6 +1215,12 @@
  remote_path = path   elif remote_path == url.hidepassword(path):   remote_path = path + if not remote_path: + gdialog.Prompt(_('No remote path specified'), + _('Please enter or select a remote path'), + self).run() + self.pathentry.grab_focus() + return   cmdline = ['hg', 'push'] + self.get_proxy_args()   if self.forcepush:   cmdline += ['--force'] @@ -1525,6 +1550,12 @@
  remote_path = path   elif remote_path == url.hidepassword(path):   remote_path = path + if not remote_path: + gdialog.Prompt(_('No remote path specified'), + _('Please enter or select a remote path'), + self).run() + self.pathentry.grab_focus() + return   node = self.repo[self.currevid].node()   cmdline = ['hg', 'push', '--rev', str(self.currevid), remote_path]   dlg = hgcmd.CmdDialog(cmdline, text='hg push')