[Merge] lp:~fullermd/bzr/revspec-dwim into lp:bzr

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Oct 16 08:55:20 BST 2009


>>>>> "Matthew" == Matthew D Fuller <fullermd at over-yonder.net> writes:

<snip/>
    >> 
    >> 1. If something looks like a revno and isn't, I'd prefer
    >> that we raised an error in that case rather than
    >> continuing to look.

IMHO, DWIM[1], is often about doing something instead of saying "I'm
afraid I can't do that Dave".

As long as it's a possible use case, that it will not backfire:
rm *.bak
rm *.bak # to be sure
No match for  *.bak, defaulting to *
<boom>
and that it frees the user from giving additional information...

 review approve

    Matthew> My feeling is that if a user enters something that
    Matthew> looks like a revno, but isn't, AND matches something
    Matthew> else in the chain (a tag being far and away the most
    Matthew> likely), that's almost certainly what they meant so
    Matthew> we should follow through with it.

Since the alternative is to give an error and that the user will
need human time to understand it, having to work harder to check
a bit more information is generally lost in the noise.

Well, if it needs to load the whole graph it may not, but that in
itself takes longer than checking a tag today and for some time
to come.

    Matthew> Ian thinks the other way; if it looks like a revno,
    Matthew> it should be assumed to be a revno, and a revno-like
    Matthew> tag is rare enough that we might as well let the
    Matthew> user disambiguate with tag: (or another spec in the
    Matthew> lookup chain as called for) if they really want it.

    Matthew> I think I'm right 8-} But I'll bow to democracy with
    Matthew> moderate grace.

Yeah, Kings tend to be a bit stiff around the neck when
confronted to the democracy in the old days...

Robert raised a concern about duplicating the revspec registry, I
think that should be kept separate from landing that patch.

DWIM is always hand-crafted and almost impossible to extend
without really looking at all the details. I don't think this
patch duplicate the revspec registry, it introduce a new kind of
revspec, use it at a very precise place and make use of other
defined revspecs.

My vote would be to land the patch as is and look if it's worth
trying to make the dwim revspec expandable (or re-definable) by
plugins in an another submission (that doesn't have to be done by
Matthew if he don't feel like it). 

           Vincent

[1]: Yeah for flas !



More information about the bazaar mailing list