[RFC] info._show_missing_revisions_working does too much?

John Arbash Meinel john at arbash-meinel.com
Wed Jul 26 22:07:30 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins 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 :)
> 
> -Rob

Well, it isn't the only reason it is slow. With an sftp branch, it also
lists the repository and stats all of the files. (Which is slow even for
a local branch).

I *think* it originally used 'delta.has_changed()' to check and see if
the working tree had been modified. The current state is crackful. It
should either do:

if delta.has_changed():
  print 'Working tree has been modified'

Or the work to create the delta should be removed.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEx9mSJdeBCYSNAAMRAhIBAJ96Vb1t+u3k60IaqR3Fkdm37lC7dACg10IE
Bsw3ghwhAn0+JixfGIFL3l0=
=L+H0
-----END PGP SIGNATURE-----




More information about the bazaar mailing list