[MERGE] Less bazaar coding style regressions.

Marius Kruger amanic at gmail.com
Sat Dec 13 12:37:06 GMT 2008


2008/12/13 Martin Pool <mbp at canonical.com>

> On 13 Dec 2008, Marius Kruger <amanic at gmail.com> wrote:
> > 2008/12/11 Robert Collins <robertc at robertcollins.net>
> >
> >     Robert Collins has voted tweak.
> >     Status is now: Conditionally approved
>


>
> > +    * ``bzr selftest`` now fails if new trailing white space is added to
> the
> > +      bazaar sources. (Marius Kruger)
> > +
>
> Please mention here that it's just checked for the pending commit.

done


> It would actually be quite cool to make this into an example of how you
> can enforce this from a precommit hook...


yes I know, I was planning to make a plugin which could aid bzr developers.


> > +        self.log("TEST LOG")
>
> ^^ why?

oops
I removed that now.


> ps I think you should call TestSource.get_bzrlib_dir, rather than doing
> it yourself.

done

latest changes diff below for easier reviewing.

thanks
marius

--
$ bzr dif -c -1
=== modified file 'NEWS'
--- NEWS        2008-12-12 23:41:15 +0000
+++ NEWS        2008-12-13 12:32:57 +0000
@@ -38,7 +38,7 @@
   TESTING:

     * ``bzr selftest`` now fails if new trailing white space is added to
the
-      bazaar sources. (Marius Kruger)
+      bazaar sources. It only checks changes not committed yet. (Marius
Kruger)

   INTERNALS:


=== modified file 'bzrlib/tests/test_source.py'
--- bzrlib/tests/test_source.py 2008-12-12 23:50:39 +0000
+++ bzrlib/tests/test_source.py 2008-12-13 12:32:57 +0000
@@ -341,7 +341,7 @@
          * new long lines (give warning only)
          * no newline at end of files
         """
-        bzr_dir = osutils.dirname(bzrlib.__path__[0])
+        bzr_dir = osutils.dirname(self.get_bzrlib_dir())
         try:
             wt = WorkingTree.open(bzr_dir)
         except:
@@ -350,7 +350,6 @@
                 % bzr_dir)
         diff_output = StringIO()
         wt.lock_read()
-        self.log("TEST LOG")
         try:
             new_tree = wt
             old_tree = new_tree.basis_tree()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20081213/eaa8751e/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_new_trailing_white_space3.patch
Type: text/x-diff
Size: 14169 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081213/eaa8751e/attachment.bin 


More information about the bazaar mailing list