status command and output styles

arnaud jeansen arnaud.jeansen at gmail.com
Sun Feb 28 22:04:46 GMT 2010


On Thu, Feb 25, 2010 at 3:42 PM, Brian de Alwis <briandealwis at gmail.com>wrote:

> [...]
>
> Arnaud, you might want to take a look at the lp:bzr-diffstat plugin:
>
> $ bzr diffstat
>  .bash_aliases                                                |   2 +
>  .bashrc-beast                                                |   7 +-
>  .bazaar/bazaar.conf                                          |   3 +-
>  .bazaar/subversion.conf                                      |   8 +-
>  .shinit                                                      |   2 +
>  .unison/dotfiles.prf                                         | 148 ++--
>  Library/Application Support/Butler/Configuration.butleritems | 358
> ++--------
>  bin/editlog                                                  |   1 +
>  bin/lsd                                                      |  11 +-
>  bin/openurl                                                  |   2 +-
>  bin/reminders                                                |   2 +
>  11 files changed, 182 insertions(+), 362 deletions(-)
>

Thanks for all the replies. Indeed, this plugin is exactly what I tried to
achieve at first. I will definitely use it.

However, I am still interested in the abstraction of the status command.
Basically, I want to separate the "model" and the "view" from the TreeDelta
class.

I started playing with the code this afternoon, and made some changes on a
local branch. However, I am stuck once again as I do not understand the
logic in status.py (snippet below).

[bzrlib/status.py]
           if short:
                changes = new.iter_changes(old, show_unchanged,
specific_files,
                    require_versioned=False,
want_unversioned=want_unversioned)
                reporter = _mod_delta._ChangeReporter(output_file=to_file,
                    unversioned_filter=new.is_ignored)
                _mod_delta.report_changes(changes, reporter)
            else:
                delta = new.changes_from(old, want_unchanged=show_unchanged,
                                      specific_files=specific_files,
                                      want_unversioned=want_unversioned)
                # filter out unknown files. We may want a tree method for
                # this
                delta.unversioned = [unversioned for unversioned in
                    delta.unversioned if not new.is_ignored(unversioned[0])]
                delta.show(to_file,
                           show_ids=show_ids,
                           show_unchanged=show_unchanged,
                           short_status=False)

Now my understanding is that "short" is only a display flag, but it seems
that we are using different code paths based on its value. Is there any
reason for this dual behaviour ?

My primary reaction was to simply unify those paths, but as I am probably
missing something, So I decided to ask here first...

Thanks,
Arnaud Jeansen

PS: please CC me on the replies, I am not subscribed to the list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20100228/e1b01023/attachment.htm 


More information about the bazaar mailing list