[Pkg-bazaar-commits] ./bzr/unstable r286: - New bzr whoami --email option

Martin Pool mbp at sourcefrog.net
Fri Apr 10 07:51:42 UTC 2009


------------------------------------------------------------
revno: 286
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Tue 2005-04-26 20:37:53 +1000
message:
  - New bzr whoami --email option
modified:
  NEWS
  bzrlib/__init__.py
  bzrlib/commands.py
  test.sh
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-04-22 01:40:26 +0000
+++ b/NEWS	2005-04-26 10:37:53 +0000
@@ -1,3 +1,11 @@
+bzr-0.0.5  NOT RELEASED YET
+
+  ENHANCEMENTS:
+
+    * New 'bzr whoami --email' option shows only the email component
+      of the user identification, from Jo Vermeulen.
+
+
 bzr-0.0.4  2005-04-22
 
   ENHANCEMENTS:

=== modified file 'bzrlib/__init__.py'
--- a/bzrlib/__init__.py	2005-04-22 01:40:26 +0000
+++ b/bzrlib/__init__.py	2005-04-26 10:37:53 +0000
@@ -41,5 +41,5 @@
 
 __copyright__ = "Copyright 2005 Canonical Development Ltd."
 __author__ = "Martin Pool <mbp at canonical.com>"
-__version__ = '0.0.4'
+__version__ = '0.0.5pre'
 

=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-04-26 10:24:32 +0000
+++ b/bzrlib/commands.py	2005-04-26 10:37:53 +0000
@@ -705,16 +705,21 @@
         sys.exit(1)
 
 
-def cmd_whoami():
+def cmd_whoami(email=False):
     """Show bzr user id.
 
     usage: bzr whoami
 
-    TODO: Command to show only the email-address part as parsed out.
+    options:
+        --email             Show only the email address.
+    
     """
-    print bzrlib.osutils.username()
-
-
+    if email:
+        print bzrlib.osutils.user_email()
+    else:
+        print bzrlib.osutils.username()
+        
+        
 def cmd_gen_revision_id():
     print bzrlib.branch._gen_revision_id(time.time())
 
@@ -825,6 +830,7 @@
     'timezone':               str,
     'verbose':                None,
     'version':                None,
+    'email':                  None,
     }
 
 SHORT_OPTIONS = {
@@ -846,6 +852,7 @@
     'ls':                     ['revision', 'verbose'],
     'remove':                 ['verbose'],
     'status':                 ['all'],
+    'whoami':                 ['email'],
     }
 
 

=== modified file 'test.sh'
--- a/test.sh	2005-04-15 09:27:48 +0000
+++ b/test.sh	2005-04-26 10:37:53 +0000
@@ -45,6 +45,10 @@
 
 [ $(bzr help commands | wc -l) -gt 20 ]
 
+# user identification is set
+bzr whoami
+bzr whoami --email
+
 # invalid commands are detected
 ! bzr pants
 
@@ -142,4 +146,4 @@
 bzr check
 
 
-echo "tests completed ok" >&3
\ No newline at end of file
+echo "tests completed ok" >&3



More information about the Pkg-bazaar-commits mailing list