[PATCH 3 of 4] convert: introduce hg.revs to replace hg.startrev and --rev with a revset

Augie Fackler raf at durin42.com
Sat Oct 5 16:24:28 CDT 2013


On Oct 3, 2013, at 11:24 AM, Mads Kiilerich <mads at kiilerich.com> wrote:

> On 10/03/2013 04:50 PM, Augie Fackler wrote:
>> On Wed, Oct 02, 2013 at 07:56:45PM +0200, Mads Kiilerich wrote:
>>> # HG changeset patch
>>> # User Mads Kiilerich <madski at unity3d.com>
>>> # Date 1374273788 -7200
>>> #      Sat Jul 20 00:43:08 2013 +0200
>>> # Node ID 103a80342ae8a92284ee184ae3232f10e93e8403
>>> # Parent  6b53306b03188cb3803a8957d73ce551ec72b0b9
>>> convert: introduce hg.revs to replace hg.startrev and --rev with a revset
>>> 
>>> The existing knobs for controlling which revisions to convert were often
>>> insufficient. Revsets is a shiny hammer that provides a better solution.
>>> 
>>> The normal fancy deprecation markup doesn't work here so we just remove the
>>> documentation of hg.startrev.
>>> 
>>> Changing --rev to take a revset for hg source repos would be a much more
>>> elegant solution ... but not backwards compatible.
>> It's new functionality, how would it fail to be backwards compatible?
>> What am I missing?
> 
> Revsets has been introduced in --rev handling in a lot of places and thus introduced new functionality. There are corner cases where it didn't stay backward compatible ... but they are few and that was probably ok.
> 
> Just sayin' that we can't do the same here. "-r 7" used to mean revision 0 to 7 - it would be a major change if it suddenly just meant revision 7. It would obviously also only work for hg sources.

Got it, that makes sense. Can you add this description to the commit message and resend?

> 
> Magic behaviour like the following might be ok for diff, but I don't think it would be ok for convert:
> 
>  $ hg init
>  $ echo 0 > f && hg ci -Am0
>  adding f
>  $ echo 1 > f && hg ci -Am1
>  $ echo 2 > f && hg ci -Am2
>  $ echo 3 > f
>  $ hg diff --nodates -r '(2)'
>  diff -r a6fee907f844 f
>  --- a/f
>  +++ b/f
>  @@ -1,1 +1,1 @@
>  -2
>  +3
>  $ hg diff --nodates -r '(1+2)'
>  diff -r c4c1f08311dd -r a6fee907f844 f
>  --- a/f
>  +++ b/f
>  @@ -1,1 +1,1 @@
>  -1
>  +2
> 
> /Mads

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131005/0964b479/attachment.pgp>


More information about the Mercurial-devel mailing list