Rev 3886: (Gordon P. Hemsley) Add a trailing slash to directories for 'bzr ls' in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Dec 9 20:53:03 GMT 2008


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

------------------------------------------------------------
revno: 3886
revision-id: pqm at pqm.ubuntu.com-20081209205258-uop2lclksyc9whj8
parent: pqm at pqm.ubuntu.com-20081209163533-fj6hx9l65sretbai
parent: gphemsley at gmail.com-20081209194959-qk6a4ho0v6qbcvrs
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2008-12-09 20:52:58 +0000
message:
  (Gordon P. Hemsley) Add a trailing slash to directories for 'bzr ls'
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
  doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
    ------------------------------------------------------------
    revno: 3883.1.6
    revision-id: gphemsley at gmail.com-20081209194959-qk6a4ho0v6qbcvrs
    parent: gphemsley at gmail.com-20081209092211-t41qyggtpohyxz3p
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 14:49:59 -0500
    message:
      Revert added slash for null-separated output of 'bzr ls'.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
    ------------------------------------------------------------
    revno: 3883.1.5
    revision-id: gphemsley at gmail.com-20081209092211-t41qyggtpohyxz3p
    parent: gphemsley at gmail.com-20081209091818-03c3z0cyty2jn2gv
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 04:22:11 -0500
    message:
      Fixed I-before-E typo in passing.
    modified:
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
    ------------------------------------------------------------
    revno: 3883.1.4
    revision-id: gphemsley at gmail.com-20081209091818-03c3z0cyty2jn2gv
    parent: gphemsley at gmail.com-20081209091359-t9j2isw8vhrpxk85
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 04:18:18 -0500
    message:
      Add note to NEWS.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3883.1.3
    revision-id: gphemsley at gmail.com-20081209091359-t9j2isw8vhrpxk85
    parent: gphemsley at gmail.com-20081209090945-dj6nxd0vdsqlc2bh
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 04:13:59 -0500
    message:
      Small optimization.
    modified:
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
    ------------------------------------------------------------
    revno: 3883.1.2
    revision-id: gphemsley at gmail.com-20081209090945-dj6nxd0vdsqlc2bh
    parent: gphemsley at gmail.com-20081209090003-jp2tf9268mfum2j3
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 04:09:45 -0500
    message:
      Change unittests to conform to new output.
    modified:
      bzrlib/tests/blackbox/test_ls.py test_ls.py-20060712232047-0jraqpecwngee12y-1
    ------------------------------------------------------------
    revno: 3883.1.1
    revision-id: gphemsley at gmail.com-20081209090003-jp2tf9268mfum2j3
    parent: pqm at pqm.ubuntu.com-20081209023452-12dbzcwzxrt1xee3
    committer: Gordon P. Hemsley <gphemsley at gmail.com>
    branch nick: bug-306424-ls-trailing-slash
    timestamp: Tue 2008-12-09 04:00:03 -0500
    message:
      Add trailing slash after directories.
    modified:
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
=== modified file 'NEWS'
--- a/NEWS	2008-12-09 16:35:33 +0000
+++ b/NEWS	2008-12-09 20:52:58 +0000
@@ -13,6 +13,8 @@
   NEW FEATURES:
 
   IMPROVEMENTS:
+    * Add trailing slash to directories in all output of ``bzr ls``, except
+      ``bzr ls --null``. (Gordon P. Hemsley, #306424)
 
   BUG FIXES:
   

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2008-12-09 15:15:08 +0000
+++ b/bzrlib/builtins.py	2008-12-09 20:52:58 +0000
@@ -1977,9 +1977,10 @@
                         continue
                     if kind is not None and fkind != kind:
                         continue
+                    kindch = entry.kind_character()
+                    outstring = fp + kindch
                     if verbose:
-                        kindch = entry.kind_character()
-                        outstring = '%-8s %s%s' % (fc, fp, kindch)
+                        outstring = '%-8s %s' % (fc, outstring)
                         if show_ids and fid is not None:
                             outstring = "%-50s %s" % (outstring, fid)
                         self.outf.write(outstring + '\n')
@@ -1996,9 +1997,9 @@
                         else:
                             my_id = ''
                         if show_ids:
-                            self.outf.write('%-50s %s\n' % (fp, my_id))
+                            self.outf.write('%-50s %s\n' % (outstring, my_id))
                         else:
-                            self.outf.write(fp + '\n')
+                            self.outf.write(outstring + '\n')
         finally:
             tree.unlock()
 

=== modified file 'bzrlib/tests/blackbox/test_ls.py'
--- a/bzrlib/tests/blackbox/test_ls.py	2008-09-24 06:52:03 +0000
+++ b/bzrlib/tests/blackbox/test_ls.py	2008-12-09 19:49:59 +0000
@@ -97,7 +97,7 @@
         self.ls_equals(
             '.bzrignore                                         \n'
             'a                                                  a-id\n'
-            'subdir                                             subdir-id\n', 
+            'subdir/                                            subdir-id\n', 
             '--show-ids')
         self.ls_equals(
             '?        .bzrignore\n'
@@ -114,7 +114,7 @@
 
         self.ls_equals('.bzrignore\n'
                        'a\n'
-                       'subdir\n'
+                       'subdir/\n'
                        , '--non-recursive')
 
         self.ls_equals('V        .bzrignore\n'
@@ -129,7 +129,7 @@
                   , '--null')
         self.ls_equals('.bzrignore\n'
                        'a\n'
-                       'subdir\n'
+                       'subdir/\n'
                        'subdir/b\n'
                        , '--from-root')
         self.ls_equals('.bzrignore\0'
@@ -139,7 +139,7 @@
                        , '--from-root --null')
         self.ls_equals('.bzrignore\n'
                        'a\n'
-                       'subdir\n'
+                       'subdir/\n'
                        , '--from-root --non-recursive')
 
     def test_ls_path(self):
@@ -151,7 +151,7 @@
         os.chdir('subdir')
         self.ls_equals('../.bzrignore\n'
                        '../a\n'
-                       '../subdir\n'
+                       '../subdir/\n'
                        '../subdir/b\n' ,
                        '..')
         self.ls_equals('../.bzrignore\0'
@@ -188,10 +188,10 @@
         self.wt.commit('committing')
         branch = self.make_branch('branchdir')
         branch.pull(self.wt.branch)
-        self.ls_equals('branchdir/subdir\n'
+        self.ls_equals('branchdir/subdir/\n'
                        'branchdir/subdir/b\n',
                        'branchdir')
-        self.ls_equals('branchdir/subdir\n'
+        self.ls_equals('branchdir/subdir/\n'
                        'branchdir/subdir/b\n',
                        'branchdir --revision 1')
 
@@ -229,7 +229,7 @@
         self.ls_equals('.bzrignore\n' 
                        'a\n', 
                        '--kind=file')
-        self.ls_equals('subdir\n',
+        self.ls_equals('subdir/\n',
                        '--kind=directory')
         self.ls_equals('',
                        '--kind=symlink')

=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt	2008-10-16 12:11:45 +0000
+++ b/doc/developers/HACKING.txt	2008-12-09 09:22:11 +0000
@@ -249,7 +249,7 @@
 
 * the reason **why** you're making this change
 
-* **how** this change acheives this purpose
+* **how** this change achieves this purpose
 
 * anything else you may have fixed in passing 
 




More information about the bazaar-commits mailing list