Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

stable tagadd: check for matching tag type when removing

Changeset b578bd829b1b

Parent 8852fb5b0461

by Wagner Bruna

Changes to one file · Browse files at b578bd829b1b Showing diff from parent 8852fb5b0461 Diff from another changeset...

 
292
293
294
295
296
 
 
 
 
 
 
 
 
 
 
 
297
298
299
300
301
302
303
 
292
293
294
 
 
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
 
311
@@ -292,12 +292,20 @@
    def remove_hg_tag(self, name, message, local, user=None, date=None,   english=False): - if hglib.fromutf(name) not in self.repo.tags(): - raise util.Abort(_("Tag '%s' does not exist") % name) + lname = hglib.fromutf(name) + + tagtype = self.repo.tagtype(lname) + if not tagtype: + raise util.Abort(_('tag \'%s\' does not exist') % lname) + if local: + if tagtype != 'local': + raise util.Abort(_('tag \'%s\' is not a local tag') % lname) + else: + if tagtype != 'global': + raise util.Abort(_('tag \'%s\' is not a global tag') % lname)     if not message:   msgset = keep._('Removed tag %s')   message = (english and msgset['id'] or msgset['str']) % name   r = self.repo[-1].node() - lname = hglib.fromutf(name)   self.repo.tag(lname, r, hglib.fromutf(message), local, user, date)