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

Mads Kiilerich mads at kiilerich.com
Thu Oct 3 10:24:06 CDT 2013


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.

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


More information about the Mercurial-devel mailing list