##// END OF EJS Templates
bookmark: use 'divergent2delete' when updating a bookmark
Boris Feld -
r33512:1424a769 default
parent child Browse files
Show More
@@ -354,7 +354,6 def calculateupdate(ui, repo, checkout):
354 def update(repo, parents, node):
354 def update(repo, parents, node):
355 deletefrom = parents
355 deletefrom = parents
356 marks = repo._bookmarks
356 marks = repo._bookmarks
357 update = False
358 active = marks.active
357 active = marks.active
359 if not active:
358 if not active:
360 return False
359 return False
@@ -368,12 +367,11 def update(repo, parents, node):
368 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
367 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
369 if validdest(repo, repo[marks[active]], new):
368 if validdest(repo, repo[marks[active]], new):
370 bmchanges.append((active, new.node()))
369 bmchanges.append((active, new.node()))
371 update = True
372
370
373 if deletedivergent(repo, deletefrom, active):
371 for bm in divergent2delete(repo, deletefrom, active):
374 update = True
372 bmchanges.append((bm, None))
375
373
376 if update:
374 if bmchanges:
377 lock = tr = None
375 lock = tr = None
378 try:
376 try:
379 lock = repo.lock()
377 lock = repo.lock()
@@ -382,7 +380,7 def update(repo, parents, node):
382 tr.close()
380 tr.close()
383 finally:
381 finally:
384 lockmod.release(tr, lock)
382 lockmod.release(tr, lock)
385 return update
383 return bool(bmchanges)
386
384
387 def listbinbookmarks(repo):
385 def listbinbookmarks(repo):
388 # We may try to list bookmarks on a repo type that does not
386 # We may try to list bookmarks on a repo type that does not
General Comments 0
You need to be logged in to leave comments. Login now