Mercurial > hg
changeset 15621:013688350c7d
bookmarks: update and updatecurrentbookmark return status
This makes bookmarks.update() and bookmarks.updatecurrentbookmark() return
True or False to indicate whether the bookmark was updated or not. This allows
callers to e.g. abort if the update failed.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Wed, 16 Nov 2011 15:29:57 -0600 |
parents | 73faa2664909 |
children | 86fc364ca5f8 |
files | mercurial/bookmarks.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/bookmarks.py Wed Dec 07 11:23:13 2011 -0600 +++ b/mercurial/bookmarks.py Wed Nov 16 15:29:57 2011 -0600 @@ -128,10 +128,10 @@ def updatecurrentbookmark(repo, oldnode, curbranch): try: - update(repo, oldnode, repo.branchtags()[curbranch]) + return update(repo, oldnode, repo.branchtags()[curbranch]) except KeyError: if curbranch == "default": # no default branch! - update(repo, oldnode, repo.lookup("tip")) + return update(repo, oldnode, repo.lookup("tip")) else: raise util.Abort(_("branch %s not found") % curbranch) @@ -147,6 +147,7 @@ update = True if update: repo._writebookmarks(marks) + return update def listbookmarks(repo): # We may try to list bookmarks on a repo type that does not