mercurial/commands.py
changeset 20234 8a133190da89
parent 20233 410193f11422
child 20235 a602d2aca8bf
equal deleted inserted replaced
20233:410193f11422 20234:8a133190da89
   806     delete = opts.get('delete')
   806     delete = opts.get('delete')
   807     rename = opts.get('rename')
   807     rename = opts.get('rename')
   808     inactive = opts.get('inactive')
   808     inactive = opts.get('inactive')
   809 
   809 
   810     hexfn = ui.debugflag and hex or short
   810     hexfn = ui.debugflag and hex or short
   811     cur   = repo.changectx('.').node()
       
   812 
   811 
   813     def checkformat(mark):
   812     def checkformat(mark):
   814         mark = mark.strip()
   813         mark = mark.strip()
   815         if not mark:
   814         if not mark:
   816             raise util.Abort(_("bookmark names cannot consist entirely of "
   815             raise util.Abort(_("bookmark names cannot consist entirely of "
   862         raise util.Abort(_("bookmark name required"))
   861         raise util.Abort(_("bookmark name required"))
   863 
   862 
   864     if delete or rename or names or inactive:
   863     if delete or rename or names or inactive:
   865         wlock = repo.wlock()
   864         wlock = repo.wlock()
   866         try:
   865         try:
       
   866             cur = repo.changectx('.').node()
   867             marks = repo._bookmarks
   867             marks = repo._bookmarks
   868             if delete:
   868             if delete:
   869                 for mark in names:
   869                 for mark in names:
   870                     if mark not in marks:
   870                     if mark not in marks:
   871                         raise util.Abort(_("bookmark '%s' does not exist") %
   871                         raise util.Abort(_("bookmark '%s' does not exist") %