Site Overlay

Mercurialized prompt

Within the last two weeks I messed up my Mercurial queue a couple of times. Working on several patches in parallel you will forget about the currently applied patch. Doing changes and refreshing the patch will overwrite the whole content of the wrong patch! That could be really bad. To circumvent such an action Jason Orendorff posted a nice solution which integrates the name of the top patch into your prompt. So it will like like:

henrik@mbp:/mozilla/mozmill-tests[privatebrowsing.patch]$

The only thing you have to do is to enter the following entry into your .bashrc or .bash_profile:
PS1='\u@\h:\w[\[`hg qtop 2>/dev/null`\]]\$ '

That’s it!

Scroll Up

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close