[Pkg-bazaar-commits] ./bzr/unstable r244: - New 'bzr log --verbose' from Sebastian Cote

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:31 UTC 2009


------------------------------------------------------------
revno: 244
committer: mbp at sourcefrog.net
timestamp: Wed 2005-04-13 12:13:10 +1000
message:
  - New 'bzr log --verbose' from Sebastian Cote
modified:
  NEWS
  bzrlib/branch.py
  bzrlib/commands.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2005-04-12 06:27:32 +0000
+++ b/NEWS	2005-04-13 02:13:10 +0000
@@ -2,11 +2,14 @@
 
   ENHANCEMENTS:
 
-    * bzr diff optionally takes a list of files to diff.  Still a bit
+    * 'bzr diff' optionally takes a list of files to diff.  Still a bit
       basic.  Patch from QuantumG.
 
     * More default ignore patterns.
 
+    * New 'bzr log --verbose' shows a list of files changed in the
+      changeset.  Patch from Sebastian Cote.
+
 
   BUG FIXES: 
 

=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2005-04-11 01:58:58 +0000
+++ b/bzrlib/branch.py	2005-04-13 02:13:10 +0000
@@ -697,7 +697,7 @@
 
 
 
-    def write_log(self, show_timezone='original'):
+    def write_log(self, show_timezone='original', verbose=False):
         """Write out human-readable log of commits to this branch
 
         :param utc: If true, show dates in universal time, not local time."""
@@ -725,6 +725,21 @@
                 for l in rev.message.split('\n'):
                     print '  ' + l
 
+            if verbose == True and precursor != None:
+                print 'changed files:'
+                tree = self.revision_tree(p)
+                prevtree = self.revision_tree(precursor)
+                
+                for file_state, fid, old_name, new_name, kind in \
+                                        diff_trees(prevtree, tree, ):
+                    if file_state == 'A' or file_state == 'M':
+                        show_status(file_state, kind, new_name)
+                    elif file_state == 'D':
+                        show_status(file_state, kind, old_name)
+                    elif file_state == 'R':
+                        show_status(file_state, kind,
+                            old_name + ' => ' + new_name)
+                
             revno += 1
             precursor = p
 
@@ -971,5 +986,3 @@
 
     s = hexlify(rand_bytes(8))
     return '-'.join((name, compact_date(time.time()), s))
-
-

=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2005-04-11 02:53:57 +0000
+++ b/bzrlib/commands.py	2005-04-13 02:13:10 +0000
@@ -509,12 +509,12 @@
     print bzrlib.branch.find_branch_root(filename)
     
 
-def cmd_log(timezone='original'):
+def cmd_log(timezone='original', verbose=False):
     """Show log of this branch.
 
     :todo: Options for utc; to show ids; to limit range; etc.
     """
-    Branch('.').write_log(show_timezone=timezone)
+    Branch('.').write_log(show_timezone=timezone, verbose=verbose)
 
 
 def cmd_ls(revision=None, verbose=False):
@@ -775,7 +775,7 @@
     'deleted':                ['show-ids'],
     'diff':                   ['revision'],
     'inventory':              ['revision'],
-    'log':                    ['timezone'],
+    'log':                    ['timezone', 'verbose'],
     'ls':                     ['revision', 'verbose'],
     'remove':                 ['verbose'],
     'status':                 ['all'],
@@ -1047,4 +1047,3 @@
     sys.exit(main(sys.argv))
     ##import profile
     ##profile.run('main(sys.argv)')
-    



More information about the Pkg-bazaar-commits mailing list