##// END OF EJS Templates
bookmarks: rename unsetcurrent to deactivate (API)...
Ryan McElroy -
r24944:08ec11e3 default
parent child Browse files
Show More
@@ -360,7 +360,7 b' def rebase(ui, repo, **opts):'
360 currentbookmarks = repo._bookmarks.copy()
360 currentbookmarks = repo._bookmarks.copy()
361 activebookmark = activebookmark or repo._bookmarkcurrent
361 activebookmark = activebookmark or repo._bookmarkcurrent
362 if activebookmark:
362 if activebookmark:
363 bookmarks.unsetcurrent(repo)
363 bookmarks.deactivate(repo)
364
364
365 extrafn = _makeextrafn(extrafns)
365 extrafn = _makeextrafn(extrafns)
366
366
@@ -61,7 +61,7 b' def strip(ui, repo, revs, update=True, b'
61 marks = repo._bookmarks
61 marks = repo._bookmarks
62 if bookmark:
62 if bookmark:
63 if bookmark == repo._bookmarkcurrent:
63 if bookmark == repo._bookmarkcurrent:
64 bookmarks.unsetcurrent(repo)
64 bookmarks.deactivate(repo)
65 del marks[bookmark]
65 del marks[bookmark]
66 marks.write()
66 marks.write()
67 ui.write(_("bookmark '%s' deleted\n") % bookmark)
67 ui.write(_("bookmark '%s' deleted\n") % bookmark)
@@ -84,7 +84,7 b' class bmstore(dict):'
84 def _writerepo(self, repo):
84 def _writerepo(self, repo):
85 """Factored out for extensibility"""
85 """Factored out for extensibility"""
86 if repo._bookmarkcurrent not in self:
86 if repo._bookmarkcurrent not in self:
87 unsetcurrent(repo)
87 deactivate(repo)
88
88
89 wlock = repo.wlock()
89 wlock = repo.wlock()
90 try:
90 try:
@@ -151,7 +151,10 b' def setcurrent(repo, mark):'
151 wlock.release()
151 wlock.release()
152 repo._bookmarkcurrent = mark
152 repo._bookmarkcurrent = mark
153
153
154 def unsetcurrent(repo):
154 def deactivate(repo):
155 """
156 Unset the active bookmark in this reposiotry.
157 """
155 wlock = repo.wlock()
158 wlock = repo.wlock()
156 try:
159 try:
157 try:
160 try:
@@ -980,7 +980,7 b' def bookmark(ui, repo, *names, **opts):'
980 raise util.Abort(_("bookmark '%s' does not exist") %
980 raise util.Abort(_("bookmark '%s' does not exist") %
981 mark)
981 mark)
982 if mark == repo._bookmarkcurrent:
982 if mark == repo._bookmarkcurrent:
983 bookmarks.unsetcurrent(repo)
983 bookmarks.deactivate(repo)
984 del marks[mark]
984 del marks[mark]
985 marks.write()
985 marks.write()
986
986
@@ -1006,7 +1006,7 b' def bookmark(ui, repo, *names, **opts):'
1006 if newact is None:
1006 if newact is None:
1007 newact = mark
1007 newact = mark
1008 if inactive and mark == repo._bookmarkcurrent:
1008 if inactive and mark == repo._bookmarkcurrent:
1009 bookmarks.unsetcurrent(repo)
1009 bookmarks.deactivate(repo)
1010 return
1010 return
1011 tgt = cur
1011 tgt = cur
1012 if rev:
1012 if rev:
@@ -1016,7 +1016,7 b' def bookmark(ui, repo, *names, **opts):'
1016 if not inactive and cur == marks[newact] and not rev:
1016 if not inactive and cur == marks[newact] and not rev:
1017 bookmarks.setcurrent(repo, newact)
1017 bookmarks.setcurrent(repo, newact)
1018 elif cur != tgt and newact == repo._bookmarkcurrent:
1018 elif cur != tgt and newact == repo._bookmarkcurrent:
1019 bookmarks.unsetcurrent(repo)
1019 bookmarks.deactivate(repo)
1020 marks.write()
1020 marks.write()
1021
1021
1022 elif inactive:
1022 elif inactive:
@@ -1025,7 +1025,7 b' def bookmark(ui, repo, *names, **opts):'
1025 elif not repo._bookmarkcurrent:
1025 elif not repo._bookmarkcurrent:
1026 ui.status(_("no active bookmark\n"))
1026 ui.status(_("no active bookmark\n"))
1027 else:
1027 else:
1028 bookmarks.unsetcurrent(repo)
1028 bookmarks.deactivate(repo)
1029 finally:
1029 finally:
1030 wlock.release()
1030 wlock.release()
1031 else: # show bookmarks
1031 else: # show bookmarks
@@ -6413,7 +6413,7 b' def update(ui, repo, node=None, rev=None'
6413 if repo._bookmarkcurrent:
6413 if repo._bookmarkcurrent:
6414 ui.status(_("(leaving bookmark %s)\n") %
6414 ui.status(_("(leaving bookmark %s)\n") %
6415 repo._bookmarkcurrent)
6415 repo._bookmarkcurrent)
6416 bookmarks.unsetcurrent(repo)
6416 bookmarks.deactivate(repo)
6417
6417
6418 return ret
6418 return ret
6419
6419
General Comments 0
You need to be logged in to leave comments. Login now