comparison mercurial/bookmarks.py @ 13663:d16c99f16f00

bundle: update current bookmark to most recent revision on current branch We check if the current bookmark is set to the first parent of the dirstate. Is this the case we move the bookmark to most recent revision on the current branch (where hg update will update you to).
author David Soria Parra <dsp@php.net>
date Mon, 14 Mar 2011 23:03:56 +0100
parents c0c599709846
children 97ed99d1f419
comparison
equal deleted inserted replaced
13662:80d6e1f63ed9 13663:d16c99f16f00
113 file.write(mark) 113 file.write(mark)
114 file.rename() 114 file.rename()
115 finally: 115 finally:
116 wlock.release() 116 wlock.release()
117 repo._bookmarkcurrent = mark 117 repo._bookmarkcurrent = mark
118
119 def updatecurrentbookmark(repo, oldnode, curbranch):
120 try:
121 update(repo, oldnode, repo.branchtags()[curbranch])
122 except KeyError:
123 if curbranch == "default": # no default branch!
124 update(repo, oldnode, repo.lookup("tip"))
125 else:
126 raise util.Abort(_("branch %s not found") % curbranch)
118 127
119 def update(repo, parents, node): 128 def update(repo, parents, node):
120 marks = repo._bookmarks 129 marks = repo._bookmarks
121 update = False 130 update = False
122 mark = repo._bookmarkcurrent 131 mark = repo._bookmarkcurrent