Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
28b73741
Commit
28b73741
authored
Jan 20, 2013
by
Yohann Bianchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADDED: Mercurial prompt info support even if hg prompt extension is unavailable
parent
8e9cf452
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
agnoster.zsh-theme
themes/agnoster.zsh-theme
+23
-6
No files found.
themes/agnoster.zsh-theme
View file @
28b73741
...
...
@@ -87,18 +87,35 @@ prompt_hg() {
local
rev status
if
$(
hg
id
>
/dev/null 2>&1
)
;
then
if
$(
hg prompt
>
/dev/null 2>&1
)
;
then
rev
=
$(
hg prompt
{
status
}
)
if
[[
$rev
=
"?"
]]
;
then
st
=
$(
hg prompt
{
status
}
)
if
[[
$st
=
"?"
]]
;
then
# if files are not added
prompt_segment red white
rev
=
'±'
elif
[[
-n
$rev
]]
;
then
st
=
'±'
elif
[[
-n
$st
]]
;
then
# if any modification
prompt_segment yellow black
rev
=
'±'
st
=
'±'
else
# if working copy is clean
prompt_segment green black
fi
echo
-n
$(
hg prompt
"⭠ {rev}@{branch}"
)
$st
else
st
=
""
rev
=
$(
hg
id
-n
2>/dev/null |
sed
's/[^-0-9]//g'
)
branch
=
$(
hg
id
-b
2>/dev/null
)
if
`
hg st |
grep
-Eq
"^
\?
"
`
;
then
prompt_segment red black
st
=
'±'
elif
`
hg st |
grep
-Eq
"^(M|A)"
`
;
then
prompt_segment yellow black
st
=
'±'
else
prompt_segment green black
fi
echo
-n
"⭠
$rev
@
$branch
"
$st
fi
echo
-n
$(
hg prompt
"⭠ {rev}@{branch}"
)
$rev
fi
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment