mercurial/bookmarks.py
changeset 17550 fc530080013b
parent 17425 e95ec38f86b0
child 17551 a7b3fdaf768d
equal deleted inserted replaced
17549:be0fcbb1c92f 17550:fc530080013b
   207             if nr in repo:
   207             if nr in repo:
   208                 cr = repo[nr]
   208                 cr = repo[nr]
   209                 cl = repo[nl]
   209                 cl = repo[nl]
   210                 if cl.rev() >= cr.rev():
   210                 if cl.rev() >= cr.rev():
   211                     continue
   211                     continue
   212                 if cr in cl.descendants():
   212                 if validdest(repo, cl, cr):
   213                     repo._bookmarks[k] = cr.node()
   213                     repo._bookmarks[k] = cr.node()
   214                     changed = True
   214                     changed = True
   215                     ui.status(_("updating bookmark %s\n") % k)
   215                     ui.status(_("updating bookmark %s\n") % k)
   216                 else:
   216                 else:
   217                     # find a unique @ suffix
   217                     # find a unique @ suffix
   250 
   250 
   251     if len(diff) <= 0:
   251     if len(diff) <= 0:
   252         ui.status(_("no changed bookmarks found\n"))
   252         ui.status(_("no changed bookmarks found\n"))
   253         return 1
   253         return 1
   254     return 0
   254     return 0
       
   255 
       
   256 def validdest(repo, old, new):
       
   257     """Is the new bookmark destination a valid update from the old one"""
       
   258     return new in old.descendants()