File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function git_ps1
2525
2626function hg_ps1
2727{
28- hg prompt " ({root|basename}@{rev}{ {status}}{>{outgoing}}{<{incoming}}) " 2> /dev/null
28+ hg prompt " ({root|basename}@{rev}{ {status}{shelf} }{>{outgoing}}{<{incoming}}) " 2> /dev/null
2929}
3030
3131PROMPT_COMMAND=' bpwd=$(basename `pwd`); echo -ne "\033]0;\007\033k${bpwd}\033\\"'
Original file line number Diff line number Diff line change @@ -313,6 +313,16 @@ def _status(m):
313313
314314 return _with_groups (g , flag ) if flag else ''
315315
316+ def _shelf (m ):
317+ try :
318+ shelves_path = repo .join ('shelves' )
319+ if os .path .exists (shelves_path ) and os .listdir (shelves_path ):
320+ return _with_groups (m .groups (), '[shelved]' )
321+ else :
322+ return ''
323+ except KeyError :
324+ return ''
325+
316326 def _tags (m ):
317327 g = m .groups ()
318328
@@ -392,6 +402,7 @@ def _update(m):
392402 'rev(\|merge)?' : _rev ,
393403 'root' : _root ,
394404 'root\|basename' : _basename ,
405+ 'shelf' :_shelf ,
395406 'status(?:'
396407 '(\|modified)'
397408 '|(\|unknown)'
You can’t perform that action at this time.
0 commit comments