[MERGE][0.11] Make log's show_log a method of LogFormatter

John Arbash Meinel john at arbash-meinel.com
Mon Aug 28 19:31:11 BST 2006


James Westby wrote:
> Hi,
> 
> I was looking at adding a bzr backend to ikiwiki, and one of the things
> which would be useful would be an xml log format (to stop people
> being malicious with log messages).
> 

...

> Also would there be any interest in an xml log format for the core? I
> guess not, though it is something that is provided by svn.

I think there is interest in an XML output. I think we should look at
the output of both Mercurial and Subversion, and see how they are the
same/how they differ. And we should try and make it as similar as we
can. (If in doubt, I would follow Subversion, because that is the more
common program, but Mercurial is closer to our model, so it might be a
better fit)

> 
> James
> 

...

> === modified file bzrlib/log.py // last-changed:jw+debian at jameswestby.net-20060
> ... 825215943-bea150ecc60c4187
> --- bzrlib/log.py
> +++ bzrlib/log.py
> @@ -57,6 +57,9 @@
>  import bzrlib.errors as errors
>  from bzrlib.trace import mutter
>  from bzrlib.tsort import merge_sort
> +from bzrlib.symbol_versioning import (deprecated_function,
> +            zero_eleven,
> +            )
>  
>  
>  def find_touching_revisions(branch, file_id):
> @@ -113,148 +116,6 @@
>      return rh
>  

...

> +        if self.specific_fileid:
> +            mutter('get log for file_id %r', self.specific_fileid)
> +
> +        branch = self.branch
> +
> +        if self.search is not None:
> +            import re
> +            searchRE = re.compile(self.search, re.IGNORECASE)
> +        else:
> +            searchRE = None
> +

v- stuff like _enumerate_history should probably be member functions,
not separate helpers.

> +        which_revs = _enumerate_history(branch)
> +        
> +        if self.start_revision is None:
> +            self.start_revision = 1
> +        else:
> +            branch.check_real_revno(self.start_revision)
> +        start_revision = self.start_revision
> +        

...

>  
>  def set_warning_method(method):
> 
> === modified file bzrlib/tests/test_log.py
> --- bzrlib/tests/test_log.py
> +++ bzrlib/tests/test_log.py
> @@ -20,14 +20,15 @@
>  from cStringIO import StringIO
>  
>  from bzrlib.tests import BzrTestBase, TestCaseWithTransport

v-- You have whitespace at the end of these lines, it would be nice to
avoid that.

> -from bzrlib.log import (show_log, 
> -                        get_view_revisions, 
> +from bzrlib.log import (get_view_revisions, 
> +                        show_log,
>                          LogFormatter, 
>                          LongLogFormatter, 
>                          ShortLogFormatter, 
>                          LineLogFormatter)
>  from bzrlib.branch import Branch
>  from bzrlib.errors import InvalidRevisionNumber
> +from bzrlib.symbol_versioning import zero_eleven
>  

...

> +    def test_deprecated(self):
> +        wt = self.make_branch_and_tree('.')
> +        b = wt.branch
> +
> +        lf = LogCatcher()
> +        wt.commit('empty commit') 
> +        self.callDeprecated([zero_eleven % 'bzrlib.log.show_log'], 
> +                             show_log, b, lf, verbose=True, 
> +                             start_revision=1, end_revision=1)
> +

^- It is also important to make sure that the output is still correct.
We want to make sure the function is deprecated, but still works.

Overall, a couple small things, but nothing that I would block on. +1
from me.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060828/4479b754/attachment.pgp 


More information about the bazaar mailing list