-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
This code
Lines 525 to 527 in 711fe28
| local pipe = io.popen("hg branch 2>&1") | |
| local output = pipe:read('*all') | |
| local rc = { pipe:close() } |
does not make use of the function specifically there for the purpose of getting the Mercurial branch information, which is at
Lines 305 to 321 in 711fe28
| --- | |
| -- Find out current branch | |
| -- @return {false|mercurial branch name} | |
| --- | |
| local function get_hg_branch() | |
| local file = io.popen("hg branch 2>nul") | |
| for line in file:lines() do | |
| local m = line:match("(.+)$") | |
| if m then | |
| file:close() | |
| return m | |
| end | |
| end | |
| file:close() | |
| return false | |
| end |
It should do that, because it is better to encapsulate details of how the branch information is obtained/formatted. For example, I use the prompt extension for Mercurial to customise the information.
Earlier versions of cmder used get_hg_branch(), and it's not clear why that was changed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels