[MERGE][0.14] Don't check plugins for tabs

Alexander Belchenko bialix at ukr.net
Wed Jan 17 23:10:39 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel пишет:
> Etienne just posted this bug:
> https://launchpad.net/bzr/+bug/80330
> 
> And I noticed there are 2 bugs in selftest.
> 
> 1) 'tools' only exists in the source tree
> 2) test_source.py is checking if plugins have tabs characters in the
> source. While I would recommend that they not avoid them, I don't think
> we should have tests failing in those circumstances. Attached is a patch
> which skips 'utils' and 'plugins', just like the copyright and gpl
> license tests.
> 

something wrong with your patch -- it seems that diff contains also
fix for problems with annotate.


- ------------------------------------------------------------------------

=== modified file 'bzrlib/annotate.py'
- --- bzrlib/annotate.py	2006-12-17 18:57:05 +0000
+++ bzrlib/annotate.py	2007-01-16 15:37:26 +0000
@@ -25,11 +25,13 @@
 # TODO: perhaps abbreviate timescales depending on how recent they are
 # e.g. "3:12 Tue", "13 Oct", "Oct 2005", etc.

+import codecs
 import sys
 import time

 from bzrlib import (
     errors,
+    osutils,
     patiencediff,
     tsort,
     )
@@ -41,6 +43,8 @@
     if to_file is None:
         to_file = sys.stdout

+    encoder = codecs.getencoder(osutils.get_user_encoding())
+
     prevanno=''
     last_rev_id = None
     if show_ids:
@@ -50,7 +54,7 @@
         max_origin_len = max(len(origin) for origin, text in annotations)
         for origin, text in annotations:
             if full or last_rev_id != origin:
- -                this = origin
+                this = encoder(origin)[0]
             else:
                 this = ''
             to_file.write('%*s | %s' % (max_origin_len, this, text))
@@ -70,6 +74,7 @@
     max_revno_len = max(max_revno_len, 3)

     for (revno_str, author, date_str, line_rev_id, text) in annotation:
+        author = encoder(author)[0]
         if verbose:
             anno = '%-*s %-*s %8s ' % (max_revno_len, revno_str,
                                        max_origin_len, author, date_str)

=== modified file 'bzrlib/tests/test_source.py'
- --- bzrlib/tests/test_source.py	2006-11-06 21:00:45 +0000
+++ bzrlib/tests/test_source.py	2007-01-17 22:33:32 +0000
@@ -258,6 +258,8 @@
         incorrect = []

         for fname, text in self.get_source_file_contents():
+            if '/util/' in fname or '/plugins/' in fname:
+                continue
             if '\t' in text:
                 incorrect.append(fname)



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFrqzvzYr338mxwCURAkSHAJ9lRoGTuHzlAOGUjlC6zMSZDtneFgCdHlBW
mV8x0T70s0dCzwV9RoUkdT0=
=iiA5
-----END PGP SIGNATURE-----




More information about the bazaar mailing list