Rev 3531: (Vitaly Chernooky) Add example script that shows branch nick in bash in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Jul 8 17:16:12 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3531
revision-id:pqm at pqm.ubuntu.com-20080708161604-6lecb3dmsyzewuoi
parent: pqm at pqm.ubuntu.com-20080707230506-82h5w03vc72dyf1a
parent: jelmer at samba.org-20080708155812-gacwrgs7d7n48a0d
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-07-08 17:16:04 +0100
message:
  (Vitaly Chernooky) Add example script that shows branch nick in bash
  	prompt.
added:
  contrib/bash/bzrbashprompt.sh  bzrbashprompt.sh-20080414112733-b78chl4ubylc6775-1
    ------------------------------------------------------------
    revno: 3528.1.1
    revision-id:jelmer at samba.org-20080708155812-gacwrgs7d7n48a0d
    parent: pqm at pqm.ubuntu.com-20080707151531-ra9moj8zrk9tiw2a
    parent: vitaly.v.ch at gmail.com-20080414113349-tiywqgi83d7a3qew
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: bashprompt
    timestamp: Tue 2008-07-08 17:58:12 +0200
    message:
      Merge bashprompt script that prints the bzr branch nick.
    added:
      contrib/bash/bzrbashprompt.sh  bzrbashprompt.sh-20080414112733-b78chl4ubylc6775-1
    ------------------------------------------------------------
    revno: 3353.1.4
    revision-id:vitaly.v.ch at gmail.com-20080414113349-tiywqgi83d7a3qew
    parent: andrew.bennetts at canonical.com-20080410091639-6hwphp6m3c0rg44t
    committer: Vitaly Chernookiy <vitaly.v.ch at gmail.com>
    branch nick: paramiko-1.7.2-compat
    timestamp: Mon 2008-04-14 11:33:49 +0000
    message:
      added contrib to improve usability
    added:
      contrib/bash/.bzrbashprompt.sh bzrbashprompt.sh-20080414112733-b78chl4ubylc6775-1
=== added file 'contrib/bash/bzrbashprompt.sh'
--- a/contrib/bash/bzrbashprompt.sh	1970-01-01 00:00:00 +0000
+++ b/contrib/bash/bzrbashprompt.sh	2008-07-08 15:58:12 +0000
@@ -0,0 +1,14 @@
+# modify PS1 to your preference and include this file in your bashrc
+# or copy to /etc/bash_completions.d.
+
+function __prompt_bzr()
+{
+	local revno nick;
+	revno=$(bzr revno 2>/dev/null) || return
+	nick=$(bzr nick 2>/dev/null) || return
+	echo "[bzr://$revno@$nick]"
+}
+
+if [ "$PS1" ]; then
+	PS1='\u@\h:$(__prompt_bzr)\W\$ '
+fi




More information about the bazaar-commits mailing list