status command and output styles

Martin Pool mbp at canonical.com
Mon Mar 1 02:53:26 GMT 2010


On 1 March 2010 09:04, arnaud jeansen <arnaud.jeansen at gmail.com> wrote:
> 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...

I don't see any good reason for it; it would be much better off
factored out into a separate class.

> PS: please CC me on the replies, I am not subscribed to the list


-- 
Martin <http://launchpad.net/~mbp/>


More information about the bazaar mailing list