[MERGE] special case the no-args version of revision-info
John Arbash Meinel
john at arbash-meinel.com
Fri Mar 14 07:19:22 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Hudson wrote:
> Robert Collins wrote:
>> Robert Collins has voted reject.
>> Status is now: Vetoed
>> Comment:
>> yeah, this is a cute but basically wrong approach, its code that we
>> don't need.
>
> Well fair enough.
>
>> I'd approve a fix to the revision spec to special case -1 though :),
>> as that has the benefit that it is in the correct location for
>> maintainers to see.
>
> That would still leave a call to get_revid_to_revno_map() unless you
> hack somewhere else too, I think?
>
> Anyway, I'm out of time for this until Monday.
>
> Cheers,
> mwh
Actually, it shouldn't. Specifically the code is doing:
if revinfo.revno is None:
dotted_map ...
print
else:
print
revinfo.revno is set when the revision is in the mainline history of the
branch.
As for overall efficiency (especially for small negative integers) we
have some api friction. Specifically the "revspec.in_history()"
implementation takes a Branch. But then it calls into
_match_on_and_check() and then _match_on() which expects to be given the
revision_history.
However, _match_on is private, so could be changed. Unfortunately it is
the standard api for all implementors to plug into. Which means that it
is an api break. It is a "_" function, but it is the primary function
implementors are expected to override.
I suppose we could use a "_match_on_no_history()" if the implementation
provides it.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH2ib6JdeBCYSNAAMRAsl8AJ96bXIohRg5Hq8JURkYuPmBG8vAAACgjuXS
S9uG7JpiqXtgRZ6BPloOyhY=
=92IN
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list