Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.1, 1.9.2, and 1.9.3

tag: fix encoding of errors, add checks for untagging

Changeset ad84d22ecd16

Parent 8c48b260ee6b

by Steve Borho

Changes to one file · Browse files at ad84d22ecd16 Showing diff from parent 8c48b260ee6b Diff from another changeset...

 
245
246
247
248
 
249
250
251
252
 
253
254
255
256
 
257
258
259
 
290
291
292
293
 
 
294
295
296
 
 
 
 
 
 
 
 
 
297
298
299
 
309
310
311
312
313
 
 
 
 
314
315
316
 
245
246
247
 
248
249
250
251
 
252
253
254
255
 
256
257
258
259
 
290
291
292
 
293
294
295
296
 
297
298
299
300
301
302
303
304
305
306
307
308
 
318
319
320
 
 
321
322
323
324
325
326
327
@@ -245,15 +245,15 @@
  try:   # tagging   if namelocal in self.repo.tags() and not force: - raise util.Abort(_("Tag '%s' already exist") % name) + raise util.Abort(keep._("Tag '%s' already exist") % namelocal)   if not local:   parents = self.repo.parents()   if len(parents) > 1: - raise util.Abort(_('uncommitted merge')) + raise util.Abort(keep._('uncommitted merge'))   bheads = self.repo.branchheads()   p1 = parents[0].node()   if not force and bheads and p1 not in bheads: - raise util.Abort(_('not at a branch head (use force)')) + raise util.Abort(keep._('not at a branch head (use force)'))   ctx = self.repo[rev]   node = ctx.node()   if not message: @@ -290,10 +290,19 @@
  tagtype = self.repo.tagtype(namelocal)   if local:   if tagtype != 'local': - raise util.Abort(_('tag \'%s\' is not a local tag') % name) + raise util.Abort(keep._('tag \'%s\' is not a local tag') % + namelocal)   else:   if tagtype != 'global': - raise util.Abort(_('tag \'%s\' is not a global tag') % name) + raise util.Abort(keep._('tag \'%s\' is not a global tag') % + namelocal) + parents = self.repo.parents() + if len(parents) > 1: + raise util.Abort(keep._('uncommitted merge')) + bheads = self.repo.branchheads() + p1 = parents[0].node() + if not force and bheads and p1 not in bheads: + raise util.Abort(keep._('not at a branch head (use force)'))   if not message:   msgset = keep._('Removed tag %s')   message = (english and msgset['id'] or msgset['str']) % namelocal @@ -309,8 +318,10 @@
  self.set_status(_("Tag '%s' has been removed") % name, True)   self.update_tagcombo()   self.close_btn.setFocus() - except: - self.set_status(_('Error in tagging'), False) + except util.Abort, e: + self.set_status(_('Abort: ') + hglib.tounicode(str(e)), False) + except Exception, e: + self.set_status(_('Error: ') + hglib.tounicode(str(e)), False)     ### Signal Handlers ###