Skip to content

Commit

Permalink
Show branch:bookmark instead of just branch. (#40)
Browse files Browse the repository at this point in the history
* Show bookmark name

* Update README.md
  • Loading branch information
danielmachado authored and victor-torres committed Feb 16, 2017
1 parent 6d3abcb commit cf9264f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Mercurial support for Atom text editor.

- line diff in text editor
- file diff in tree view
- branch name in status bar
- bookmark:branch or branch name in status bar

## How to use it

Expand Down
14 changes: 11 additions & 3 deletions lib/hg-utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,18 @@ class Repository

getShortHead: () ->
branchFile = @rootPath + '/.hg/branch'
if !fs.existsSync(branchFile)
return 'default'
bookmarkFile = @rootPath + '/.hg/bookmarks.current'
prompt = ''

return fs.readFileSync branchFile, 'utf8'
if (!fs.existsSync(branchFile))
prompt = 'default'
else
prompt = fs.readFileSync branchFile, 'utf8'

if (fs.existsSync(bookmarkFile))
prompt = prompt + ':' + fs.readFileSync bookmarkFile, 'utf8'

return prompt

###
Section: TreeView Path Mercurial status
Expand Down

0 comments on commit cf9264f

Please sign in to comment.