{"action":"created","issue":{"url":"https://api.github.com/repos/nojhan/liquidprompt/issues/403","labels_url":"https://api.github.com/repos/nojhan/liquidprompt/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/nojhan/liquidprompt/issues/403/comments","events_url":"https://api.github.com/repos/nojhan/liquidprompt/issues/403/events","html_url":"https://github.com/nojhan/liquidprompt/pull/403","id":115034653,"number":403,"title":"also display the currently active bookmark (if any) in mercurial","user":{"login":"hcgraf","id":10207468,"avatar_url":"https://avatars.githubusercontent.com/u/10207468?v=3","gravatar_id":"","url":"https://api.github.com/users/hcgraf","html_url":"https://github.com/hcgraf","followers_url":"https://api.github.com/users/hcgraf/followers","following_url":"https://api.github.com/users/hcgraf/following{/other_user}","gists_url":"https://api.github.com/users/hcgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/hcgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcgraf/subscriptions","organizations_url":"https://api.github.com/users/hcgraf/orgs","repos_url":"https://api.github.com/users/hcgraf/repos","events_url":"https://api.github.com/users/hcgraf/events{/privacy}","received_events_url":"https://api.github.com/users/hcgraf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nojhan/liquidprompt/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nojhan/liquidprompt/labels/Mercurial","name":"Mercurial","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-04T11:40:30Z","updated_at":"2015-11-14T12:55:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nojhan/liquidprompt/pulls/403","html_url":"https://github.com/nojhan/liquidprompt/pull/403","diff_url":"https://github.com/nojhan/liquidprompt/pull/403.diff","patch_url":"https://github.com/nojhan/liquidprompt/pull/403.patch"},"body":"In Mercurial, \"bookmarks\" is the concept which closely resembles \"branches\" in git.\r\n(real mercurial \"branches\" are part of a commits metadata, afaik there is nothing like that in git)\r\n\r\nMany developers use bookmarks instead of named branches, so the display of the current branch is not very useful for them.\r\n\r\nThis PR checks if there is an active bookmark in the current repository (\"active\" means it would be moved with a commit).\r\nIf so, the bookmark name will be shown together with the branch name as `branch`,`bookmark`.\r\nIf there is no currently active bookmark, only `branch` (no trailing comma) will be shown.\r\n\r\nTested with bash & zsh."},"comment":{"url":"https://api.github.com/repos/nojhan/liquidprompt/issues/comments/156693821","html_url":"https://github.com/nojhan/liquidprompt/pull/403#issuecomment-156693821","issue_url":"https://api.github.com/repos/nojhan/liquidprompt/issues/403","id":156693821,"user":{"login":"nedbat","id":23789,"avatar_url":"https://avatars.githubusercontent.com/u/23789?v=3","gravatar_id":"","url":"https://api.github.com/users/nedbat","html_url":"https://github.com/nedbat","followers_url":"https://api.github.com/users/nedbat/followers","following_url":"https://api.github.com/users/nedbat/following{/other_user}","gists_url":"https://api.github.com/users/nedbat/gists{/gist_id}","starred_url":"https://api.github.com/users/nedbat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nedbat/subscriptions","organizations_url":"https://api.github.com/users/nedbat/orgs","repos_url":"https://api.github.com/users/nedbat/repos","events_url":"https://api.github.com/users/nedbat/events{/privacy}","received_events_url":"https://api.github.com/users/nedbat/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T12:55:36Z","updated_at":"2015-11-14T12:55:36Z","body":"I tried this on my Mac, and it did not find bookmarks.  It worked if I changed the sed line:\r\n```\r\ndiff --git a/liquidprompt b/liquidprompt\r\nindex f6dcab9..0167f55 100755\r\n--- a/liquidprompt\r\n+++ b/liquidprompt\r\n@@ -907,7 +907,7 @@ _lp_hg_branch_color()\r\n \r\n         # extract currently active bookmark, if any\r\n         local bookmark\r\n-        bookmark=\"$(hg bookmarks | sed -n 's/^ \\* \\(.*[^ ]\\) *[0-9]\\+:[0-9a-f]*$/\\1/p')\"\r\n+        bookmark=\"$(hg bookmarks | sed -n 's/^ \\* \\([^ ][^ ]*\\) *[0-9][0-9]*:[0-9a-f]*$/\\1/p')\"\r\n         if [[ -n \"$bookmark\" ]]; then\r\n             bookmark=\",$(_lp_escape \"$bookmark\")\"\r\n         fi\r\n```"}}