"update -r REVNO" support

Matthew D. Fuller fullermd at over-yonder.net
Mon Aug 6 06:34:07 BST 2007


On Mon, Aug 06, 2007 at 03:25:45PM +1000 I heard the voice of
Martin Pool, and lo! it spake thus:
> > +                b_revno = wt.branch.last_revision_info()[0]
> > +                wt_revno = wt.branch.revision_id_to_revno(wt.last_revision())
> > +                missing = b_revno - wt_revno
> > +                warning("Working tree is at revno %d missing %d revision%s!" %
> > +                        (wt_revno, missing,
> > +                         (missing > 1) and "s" or ""))
> 
> Giving more information here is good.

But correct information is better.  The above fails twice if the
working tree is on a non-mainline revision; first because
revision_id_to_revno() doesn't give you an answer in that case, and
second because the subtraction wouldn't give you a useful answer if it
did ("How the heck am I 7.8.37.931.5 revisions out of date?!")

It would probably be better just to say "Branch is at revision X,
working tree at revision Y.Z".



-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



More information about the bazaar mailing list