[RFC] info._show_missing_revisions_working does too much?
Martin Pool
mbp at canonical.com
Wed Jul 26 07:50:37 BST 2006
On 26 Jul 2006, Robert Collins <robertc at robertcollins.net> wrote:
>
> def _show_missing_revisions_working(working):
> """Show missing revisions in working tree."""
> branch = working.branch
> basis = working.basis_tree()
> work_inv = working.inventory
> delta = diff.compare_trees(basis, working, want_unchanged=True)
> history = branch.revision_history()
> tree_last_id = working.last_revision()
>
> if len(history) and tree_last_id != history[-1]:
> tree_last_revno = branch.revision_id_to_revno(tree_last_id)
> missing_count = len(history) - tree_last_revno
> print
> print 'Working tree is out of date: missing %d revision%s.' % (
> missing_count, plural(missing_count))
>
> This seems semi-crackful to me - it does a tree delta, gets a basis tree
> etc, but never uses them. This might be part of why info is slow :)
And the comparison and message is a bit wrong too: as was recently
discussed, after an uncommit it's possible for the tree to be out of
date in a way that isn't describe by an integer number of revisions. So
perhaps we should just say "Working tree is out of date with branch".
And perhaps that comparison should be lifted out to e.g. a tree
method.
--
Martin
More information about the bazaar
mailing list