comparison mercurial/bookmarks.py @ 15237:7196ed7a1505

bookmarks: delegate writing to the repo just like reading This makes it easier for alternate storage backends to not use flat files for bookmarks storage.
author Augie Fackler <durin42@gmail.com>
date Wed, 12 Oct 2011 11:09:57 -0500
parents 774da7121fc9
children 2fad18f15409
comparison
equal deleted inserted replaced
15236:4fae5df4b1bb 15237:7196ed7a1505
144 new = repo[node] 144 new = repo[node]
145 if new in old.descendants(): 145 if new in old.descendants():
146 marks[mark] = new.node() 146 marks[mark] = new.node()
147 update = True 147 update = True
148 if update: 148 if update:
149 write(repo) 149 repo._writebookmarks(marks)
150 150
151 def listbookmarks(repo): 151 def listbookmarks(repo):
152 # We may try to list bookmarks on a repo type that does not 152 # We may try to list bookmarks on a repo type that does not
153 # support it (e.g., statichttprepository). 153 # support it (e.g., statichttprepository).
154 marks = getattr(repo, '_bookmarks', {}) 154 marks = getattr(repo, '_bookmarks', {})